I have a problem with gridview and column. In this case, i want put an image in upper of gridview. Please give me a solution..
return new Container(
child: new
If Column is the parent of GridView
then it will give rendering issue as
It happens because Column
and GridView
both take the entire space of the screen individually which is there default behavior(Default axis of scrolling is Vertical).
Solution:
To solve the above problem we have to disable scrolling of GridView
, This can be possible by shrinkWrap and physics property
shrinkWrap:true - With this GridView
only occupies the space it needs
physics: NeverScrollableScrollPhysics() - It disables scrolling functionality of GridView
, which means now we have only SingleChildScrollView
who provide the scrolling functionality.
Code:
SingleChildScrollView
Column
GridView(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
//...
)