File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -859,9 +859,19 @@ class DefaultAssetPickerBuilderDelegate
859
859
return LayoutBuilder (
860
860
builder: (BuildContext c, BoxConstraints constraints) {
861
861
final double itemSize = constraints.maxWidth / gridCount;
862
- // Reduce [permissionLimitedBarHeight] for the final height.
863
- final double height =
864
- constraints.maxHeight - permissionLimitedBarHeight;
862
+ // Check whether all rows can be placed at the same time.
863
+ final bool onlyOneScreen = row * itemSize <=
864
+ constraints.maxHeight -
865
+ context.bottomPadding -
866
+ topPadding -
867
+ permissionLimitedBarHeight;
868
+ final double height;
869
+ if (onlyOneScreen) {
870
+ height = constraints.maxHeight;
871
+ } else {
872
+ // Reduce [permissionLimitedBarHeight] for the final height.
873
+ height = constraints.maxHeight - permissionLimitedBarHeight;
874
+ }
865
875
// Use [ScrollView.anchor] to determine where is the first place of
866
876
// the [SliverGrid]. Each row needs [dividedSpacing] to calculate,
867
877
// then minus one times of [itemSpacing] because spacing's count in the
You can’t perform that action at this time.
0 commit comments