Shear dilatation/contraction of granular materials has long been recognized as an important process in granular flows but a comprehensive theoretical description of this process for a wide range of shear rates is not yet available. In this paper, a theoretical formulation of dilatation/contraction is proposed for continuum modelling of granular flows, in which the dilatation/contraction effects consist of a frictional component, which results from the rearrangement of enduring-contact force chains among particles, and a collisional component, which arises from inter-grain collisions. In this formulation, a frictional solid pressure, which considers the rearrangement of contact force chains under shear deformation, is proposed for the frictional dilatation/contraction, while well-established rheological laws are adopted for the collisional inter-grain pressure to account for the collisional dilatancy effect. The proposed formulation is first verified analytically by describing the shear-weakening behaviour of granular samples in a torsional shear rheometer and by capturing the incipient failure of both dry and immersed granular slopes. The proposed dilatation/contraction formulation is then further validated numerically by integrating it into a two-fluid continuum model and applying the model to study the collapse of submerged granular columns, in which the dilatation/contraction plays a critical role.