@@ -28,8 +28,8 @@ class GridList<T> extends StatelessWidget {
2828 required this .createListItem,
2929 this .heightOverride,
3030 this .longBottomSheetHeightOverride,
31- this .longBottomSheetAspectRatio = 0.73 ,
32- this .itemAspectRatio = 0.85 ,
31+ this .longBottomSheetAspectRatio = 0.79 ,
32+ this .itemAspectRatio = 0.75 ,
3333 });
3434
3535 final GridListState state;
@@ -82,29 +82,32 @@ class GridList<T> extends StatelessWidget {
8282 return ValueListenableBuilder (
8383 valueListenable: provider.itemList,
8484 builder: (context, List <GridListItemModel <T >> value, child) {
85+ // Get the number of items to display, and the height of the grid list
8586 int itemCount;
8687 double height;
8788 switch (state) {
8889 case GridListState .short:
8990 itemCount = min (8 , value.length);
90- height = longBottomSheet ? 120 : (size.height * 0.3 ) ;
91+ height = longBottomSheet ? 140 : 280 ;
9192 break ;
9293 case GridListState .long:
9394 itemCount = value.length;
94- height = longBottomSheet ? 240 : (size.height * 0.6 ) ;
95+ height = longBottomSheet ? 200 : 560 ;
9596 break ;
9697 case GridListState .extraShort:
9798 itemCount = min (4 , value.length);
98- height = 120 ;
99+ height = 140 ;
99100 break ;
100101 }
101102
103+ // Handle overrides
102104 if (longBottomSheet && longBottomSheetHeightOverride != null ) {
103105 height = longBottomSheetHeightOverride! ;
104106 } else if (! longBottomSheet && heightOverride != null ) {
105107 height = heightOverride! ;
106108 }
107109
110+ // Handle keyboard visibility if we have an empty list
108111 if (value.isEmpty) {
109112 return KeyboardVisibilityBuilder (
110113 builder: (context, isKeyboardVisible) {
@@ -139,6 +142,8 @@ class GridList<T> extends StatelessWidget {
139142 itemCount: itemCount,
140143 gridDelegate: SliverGridDelegateWithFixedCrossAxisCount (
141144 crossAxisCount: longBottomSheet ? 8 : 4 ,
145+ mainAxisSpacing: 8.0 ,
146+ crossAxisSpacing: 8.0 ,
142147 childAspectRatio: longBottomSheet
143148 ? longBottomSheetAspectRatio
144149 : itemAspectRatio,
0 commit comments