Example:
I want to reduce the width of this picture with childAspectRatio without knowing the values. The image above shows my layout. Is there a way to reduce the with of the GridViewItems, when I am not having the exact values of for using the child-aspect ratio properly?
Here is my code:
Widget build(BuildContext context) {
final width = MediaQuery.of(context).size.width;
final height = MediaQuery.of(context).size.height;
logger("width => $width");
logger("height => $height");
return GridView.count(
childAspectRatio: .9/.2,
// childAspectRatio: 6,
// padding:EdgeInsets.only(right: 250),
mainAxisSpacing: 10,
crossAxisSpacing: 25,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
crossAxisCount: width < 1510
? 2
: width < 1537
? 3
: 1,
children: <Widget>[
SelectCargoDropDown(),
CargoCampaignDropDown(),
FreeCargoNumberField(),
IdSelectionDropDown(),
AuthSellingDropDown(),
PharmacyReferenceDropDown(),
InformationPersonReferenceDropDown(),
],);
