In this example, I will share how to make a bottom sheet with height follow the amount of item of JSON. You are also using Expanded in this Column which creates the empty space if there are less items in the GridView. Remove this Expanded widget.
1 2 3 4 5 6 7 8 | Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisSize: MainAxisSize.min, // 1st use min not max children: <Widget>[ Container(...), GridView.builder(...), // 2nd remove Expanded ], ) |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.