@@ -512,7 +512,7 @@ abstract class AssetPickerBuilderDelegate<Asset, Path> {
512
512
color: theme.primaryColor.withOpacity (isAppleOS ? 0.90 : 1 ),
513
513
child: Row (
514
514
children: < Widget > [
515
- if (! isSingleAssetMode || ! isAppleOS) previewButton (context),
515
+ if (! isAppleOS) previewButton (context),
516
516
if (isAppleOS) const Spacer (),
517
517
if (isAppleOS) confirmButton (context),
518
518
],
@@ -898,11 +898,8 @@ class DefaultAssetPickerBuilderDelegate
898
898
// - On Android, show if preview is enabled or if multi asset mode.
899
899
// If no preview and single asset mode, do not show confirm button,
900
900
// because any click on an asset selects it.
901
- // - On iOS, show if no preview and multi asset mode. This is because for iOS
902
- // the [bottomActionBar] has the confirm button, but if no preview,
903
- // [bottomActionBar] is not displayed.
904
- actions: (! isAppleOS || ! isPreviewEnabled) &&
905
- (isPreviewEnabled || ! isSingleAssetMode)
901
+ // - On iOS and macOS, show nothing.
902
+ actions: ! isAppleOS && ! isSingleAssetMode
906
903
? < Widget > [confirmButton (context)]
907
904
: null ,
908
905
actionsPadding: const EdgeInsetsDirectional .only (end: 14 ),
@@ -954,7 +951,7 @@ class DefaultAssetPickerBuilderDelegate
954
951
child: Stack (
955
952
children: < Widget > [
956
953
Positioned .fill (child: assetsGridBuilder (context)),
957
- if (( ! isSingleAssetMode || isAppleOS) && isPreviewEnabled )
954
+ if (! isSingleAssetMode || isAppleOS)
958
955
Positioned .fill (
959
956
top: null ,
960
957
child: bottomActionBar (context),
@@ -1032,7 +1029,7 @@ class DefaultAssetPickerBuilderDelegate
1032
1029
return Selector <DefaultAssetPickerProvider , PathWrapper <AssetPathEntity >?>(
1033
1030
selector: (_, DefaultAssetPickerProvider p) => p.currentPath,
1034
1031
builder: (
1035
- BuildContext context ,
1032
+ BuildContext _context ,
1036
1033
PathWrapper <AssetPathEntity >? wrapper,
1037
1034
__,
1038
1035
) {
@@ -1042,7 +1039,7 @@ class DefaultAssetPickerBuilderDelegate
1042
1039
// If user chose a special item's position, add 1 count.
1043
1040
if (specialItemPosition != SpecialItemPosition .none) {
1044
1041
specialItem = specialItemBuilder? .call (
1045
- context ,
1042
+ _context ,
1046
1043
wrapper? .path,
1047
1044
totalCount,
1048
1045
);
@@ -1053,7 +1050,7 @@ class DefaultAssetPickerBuilderDelegate
1053
1050
specialItem = null ;
1054
1051
}
1055
1052
if (totalCount == 0 && specialItem == null ) {
1056
- return loadingIndicator (context );
1053
+ return loadingIndicator (_context );
1057
1054
}
1058
1055
// Then we use the [totalCount] to calculate placeholders we need.
1059
1056
final int placeholderCount;
@@ -1071,13 +1068,13 @@ class DefaultAssetPickerBuilderDelegate
1071
1068
// [gridCount] since every grid item is squeezed by the [itemSpacing],
1072
1069
// and it's actual size is reduced with [itemSpacing / gridCount].
1073
1070
final double dividedSpacing = itemSpacing / gridCount;
1074
- final double topPadding = context .topPadding + kToolbarHeight;
1071
+ final double topPadding = _context .topPadding + kToolbarHeight;
1075
1072
1076
- Widget _sliverGrid (BuildContext context , List <AssetEntity > assets) {
1073
+ Widget _sliverGrid (BuildContext _context , List <AssetEntity > assets) {
1077
1074
return SliverGrid (
1078
1075
delegate: SliverChildBuilderDelegate (
1079
1076
(_, int index) => Builder (
1080
- builder: (BuildContext context ) {
1077
+ builder: (BuildContext _context ) {
1081
1078
if (effectiveShouldRevertGrid) {
1082
1079
if (index < placeholderCount) {
1083
1080
return const SizedBox .shrink ();
@@ -1088,7 +1085,7 @@ class DefaultAssetPickerBuilderDelegate
1088
1085
child: Directionality (
1089
1086
textDirection: Directionality .of (context),
1090
1087
child: assetGridItemBuilder (
1091
- context ,
1088
+ _context ,
1092
1089
index,
1093
1090
assets,
1094
1091
specialItem: specialItem,
@@ -1098,7 +1095,7 @@ class DefaultAssetPickerBuilderDelegate
1098
1095
},
1099
1096
),
1100
1097
childCount: assetsGridItemCount (
1101
- context: context ,
1098
+ context: _context ,
1102
1099
assets: assets,
1103
1100
placeholderCount: placeholderCount,
1104
1101
specialItem: specialItem,
@@ -1125,7 +1122,7 @@ class DefaultAssetPickerBuilderDelegate
1125
1122
}
1126
1123
1127
1124
return LayoutBuilder (
1128
- builder: (BuildContext c , BoxConstraints constraints) {
1125
+ builder: (BuildContext context , BoxConstraints constraints) {
1129
1126
final double itemSize = constraints.maxWidth / gridCount;
1130
1127
// Check whether all rows can be placed at the same time.
1131
1128
final bool onlyOneScreen = row * itemSize <=
@@ -1157,7 +1154,7 @@ class DefaultAssetPickerBuilderDelegate
1157
1154
child: Selector <DefaultAssetPickerProvider , List <AssetEntity >>(
1158
1155
selector: (_, DefaultAssetPickerProvider p) =>
1159
1156
p.currentAssets,
1160
- builder: (_ , List <AssetEntity > assets, __ ) {
1157
+ builder: (BuildContext context , List <AssetEntity > assets, _ ) {
1161
1158
final SliverGap bottomGap = SliverGap .v (
1162
1159
context.bottomPadding + bottomSectionHeight,
1163
1160
);
@@ -1169,7 +1166,7 @@ class DefaultAssetPickerBuilderDelegate
1169
1166
slivers: < Widget > [
1170
1167
if (isAppleOS)
1171
1168
SliverGap .v (context.topPadding + kToolbarHeight),
1172
- _sliverGrid (_ , assets),
1169
+ _sliverGrid (context , assets),
1173
1170
// Ignore the gap when the [anchor] is not equal to 1.
1174
1171
if (effectiveShouldRevertGrid && anchor == 1 ) bottomGap,
1175
1172
if (effectiveShouldRevertGrid)
0 commit comments