I'm trying to display grid view, but I got an error saying "Incorrect use of ParentDataWidget".
Here is my code:
body: Container {
...
child: Column {
children : [
Container {
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 4,
),
children: [
CircleAvatar(
child: Icon(
Icons.person,
),
backgroundColor: Colors.black,
),
CircleAvatar(
child: Icon(
Icons.person,
),
backgroundColor: Colors.black,
),
CircleAvatar(
child: Icon(
Icons.person,
),
backgroundColor: Colors.black,
),
]
)
}
]
}
}
And here is the error:
- Incorrect use of ParentDataWidget.
- Vertical viewport was given unbounded height.
- RenderBox was not laid out: RenderViewport#8c1a9 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE 'package:flutter/src/rendering/box.dart': Failed assertion: line 1927 pos 12: 'hasSize'
Any solutions?