Problem: The grid item (skill card) does not take a specified height and width. instead, takes the height of the gridview (SizeBox(height:200))/crossAxisCount.
I want to give a specific width and height to the gridview. but it does not work.
I want the SkillCard()
to take the specified height and width. How do I do that?
SizedBox(
height: 200,
child: GridView.custom(
padding: const EdgeInsets.all(20),
gridDelegate:
const SliverGridDelegateWithFixedCrossAxisCount(
// mainAxisExtent: 100,
crossAxisCount: 3,
),
childrenDelegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return const SkillCard(
skill: 'Flutter',
percent: 75,
icon: flutterLogo,
height: 20,
width: 20,
);
},
childCount: 9, // Total number of items
),
),
),
2
Answers
try this code to solve your issues.
Give this code a try: