@@ -480,7 +480,8 @@ class FileAssetPickerBuilder
480
480
child: Column (
481
481
children: < Widget > [
482
482
Expanded (child: assetsGridBuilder (context)),
483
- if (! isAppleOS) bottomActionBar (context),
483
+ if (! isAppleOS (context))
484
+ bottomActionBar (context),
484
485
],
485
486
),
486
487
),
@@ -502,10 +503,10 @@ class FileAssetPickerBuilder
502
503
PreferredSizeWidget appBar (BuildContext context) {
503
504
return AppBar (
504
505
backgroundColor: theme.appBarTheme.backgroundColor,
505
- centerTitle: isAppleOS,
506
+ centerTitle: isAppleOS (context) ,
506
507
title: pathEntitySelector (context),
507
508
leading: backButton (context),
508
- actions: ! isAppleOS
509
+ actions: ! isAppleOS (context)
509
510
? < Widget > [
510
511
confirmButton (context),
511
512
const SizedBox (width: 14.0 ),
@@ -537,7 +538,7 @@ class FileAssetPickerBuilder
537
538
Positioned .fill (
538
539
child: assetsGridBuilder (context),
539
540
),
540
- if (! isSingleAssetMode || isAppleOS)
541
+ if (! isSingleAssetMode || isAppleOS (context) )
541
542
PositionedDirectional (
542
543
bottom: 0.0 ,
543
544
child: bottomActionBar (context),
@@ -589,7 +590,7 @@ class FileAssetPickerBuilder
589
590
totalCount += 1 ;
590
591
}
591
592
final int placeholderCount;
592
- if (isAppleOS && totalCount % gridCount != 0 ) {
593
+ if (isAppleOS (context) && totalCount % gridCount != 0 ) {
593
594
placeholderCount = gridCount - totalCount % gridCount;
594
595
} else {
595
596
placeholderCount = 0 ;
@@ -604,7 +605,7 @@ class FileAssetPickerBuilder
604
605
delegate: SliverChildBuilderDelegate (
605
606
(_, int index) => Builder (
606
607
builder: (BuildContext c) {
607
- if (isAppleOS) {
608
+ if (isAppleOS (context) ) {
608
609
if (index < placeholderCount) {
609
610
return const SizedBox .shrink ();
610
611
}
@@ -663,10 +664,10 @@ class FileAssetPickerBuilder
663
664
builder: (_, List <File > assets, __) => CustomScrollView (
664
665
physics: const AlwaysScrollableScrollPhysics (),
665
666
controller: gridScrollController,
666
- anchor: isAppleOS ? anchor : 0 ,
667
- center: isAppleOS ? gridRevertKey : null ,
667
+ anchor: isAppleOS (context) ? anchor : 0 ,
668
+ center: isAppleOS (context) ? gridRevertKey : null ,
668
669
slivers: < Widget > [
669
- if (isAppleOS)
670
+ if (isAppleOS (context) )
670
671
SliverToBoxAdapter (
671
672
child: SizedBox (
672
673
height:
@@ -675,14 +676,14 @@ class FileAssetPickerBuilder
675
676
),
676
677
sliverGrid (_, assets),
677
678
// Ignore the gap when the [anchor] is not equal to 1.
678
- if (isAppleOS && anchor == 1 )
679
+ if (isAppleOS (context) && anchor == 1 )
679
680
SliverToBoxAdapter (
680
681
child: SizedBox (
681
682
height: MediaQuery .of (context).padding.bottom +
682
683
bottomSectionHeight,
683
684
),
684
685
),
685
- if (isAppleOS)
686
+ if (isAppleOS (context) )
686
687
SliverToBoxAdapter (
687
688
key: gridRevertKey,
688
689
child: const SizedBox .shrink (),
@@ -829,20 +830,20 @@ class FileAssetPickerBuilder
829
830
builder: (_, bool isSwitchingPath, Widget ? w) => AnimatedPositioned (
830
831
duration: switchingPathDuration,
831
832
curve: switchingPathCurve,
832
- top: isAppleOS
833
+ top: isAppleOS (context)
833
834
? ! isSwitchingPath
834
835
? - maxHeight
835
836
: appBarHeight
836
837
: - (! isSwitchingPath ? maxHeight : 1.0 ),
837
838
child: AnimatedOpacity (
838
839
duration: switchingPathDuration,
839
840
curve: switchingPathCurve,
840
- opacity: ! isAppleOS || isSwitchingPath ? 1.0 : 0.0 ,
841
+ opacity: ! isAppleOS (context) || isSwitchingPath ? 1.0 : 0.0 ,
841
842
child: Container (
842
843
width: MediaQuery .sizeOf (context).width,
843
844
height: maxHeight,
844
845
decoration: BoxDecoration (
845
- borderRadius: isAppleOS
846
+ borderRadius: isAppleOS (context)
846
847
? const BorderRadius .vertical (bottom: Radius .circular (10.0 ))
847
848
: null ,
848
849
color: theme.colorScheme.background,
@@ -970,7 +971,7 @@ class FileAssetPickerBuilder
970
971
isSwitchingPath.value = false ;
971
972
},
972
973
child: SizedBox (
973
- height: isAppleOS ? 64.0 : 52.0 ,
974
+ height: isAppleOS (context) ? 64.0 : 52.0 ,
974
975
child: Row (
975
976
children: < Widget > [
976
977
RepaintBoundary (
@@ -1085,15 +1086,15 @@ class FileAssetPickerBuilder
1085
1086
margin: EdgeInsets .all (
1086
1087
MediaQuery .sizeOf (context).width /
1087
1088
gridCount /
1088
- (isAppleOS ? 12.0 : 15.0 ),
1089
+ (isAppleOS (context) ? 12.0 : 15.0 ),
1089
1090
),
1090
1091
width: indicatorSize,
1091
1092
height: indicatorSize,
1092
1093
alignment: AlignmentDirectional .topEnd,
1093
1094
child: AnimatedContainer (
1094
1095
duration: switchingPathDuration,
1095
- width: indicatorSize / (isAppleOS ? 1.25 : 1.5 ),
1096
- height: indicatorSize / (isAppleOS ? 1.25 : 1.5 ),
1096
+ width: indicatorSize / (isAppleOS (context) ? 1.25 : 1.5 ),
1097
+ height: indicatorSize / (isAppleOS (context) ? 1.25 : 1.5 ),
1097
1098
decoration: BoxDecoration (
1098
1099
border: ! isSelected
1099
1100
? Border .all (color: Colors .white, width: 2.0 )
@@ -1113,8 +1114,8 @@ class FileAssetPickerBuilder
1113
1114
color: isSelected
1114
1115
? theme.textTheme.bodyLarge? .color
1115
1116
: null ,
1116
- fontSize: isAppleOS ? 16.0 : 14.0 ,
1117
- fontWeight: isAppleOS
1117
+ fontSize: isAppleOS (context) ? 16.0 : 14.0 ,
1118
+ fontWeight: isAppleOS (context)
1118
1119
? FontWeight .w600
1119
1120
: FontWeight .bold,
1120
1121
),
@@ -1187,7 +1188,7 @@ class FileAssetPickerBuilder
1187
1188
child: Stack (
1188
1189
fit: StackFit .expand,
1189
1190
children: < Widget > [
1190
- if (isAppleOS) appleOSLayout (c) else androidLayout (c),
1191
+ if (isAppleOS (context) ) appleOSLayout (c) else androidLayout (c),
1191
1192
if (Platform .isIOS) iOSPermissionOverlay (c),
1192
1193
],
1193
1194
),
@@ -1288,7 +1289,7 @@ class FileAssetPickerViewerBuilderDelegate
1288
1289
mainAxisAlignment: MainAxisAlignment .spaceBetween,
1289
1290
children: < Widget > [
1290
1291
const Spacer (),
1291
- if (isAppleOS && provider != null )
1292
+ if (isAppleOS (context) && provider != null )
1292
1293
ChangeNotifierProvider <
1293
1294
AssetPickerViewerProvider <File >>.value (
1294
1295
value: provider! ,
@@ -1383,7 +1384,7 @@ class FileAssetPickerViewerBuilderDelegate
1383
1384
child: Row (
1384
1385
children: < Widget > [
1385
1386
const BackButton (),
1386
- if (! isAppleOS)
1387
+ if (! isAppleOS (context) )
1387
1388
StreamBuilder <int >(
1388
1389
initialData: currentIndex,
1389
1390
stream: pageStreamController.stream,
@@ -1398,8 +1399,8 @@ class FileAssetPickerViewerBuilderDelegate
1398
1399
},
1399
1400
),
1400
1401
const Spacer (),
1401
- if (isAppleOS && provider != null ) selectButton (context),
1402
- if (! isAppleOS && provider != null ) confirmButton (context),
1402
+ if (isAppleOS (context) && provider != null ) selectButton (context),
1403
+ if (! isAppleOS (context) && provider != null ) confirmButton (context),
1403
1404
],
1404
1405
),
1405
1406
),
@@ -1512,7 +1513,7 @@ class FileAssetPickerViewerBuilderDelegate
1512
1513
final File asset = previewAssets.elementAt (snapshot.data! );
1513
1514
final bool isSelected =
1514
1515
currentlySelectedAssets.contains (asset);
1515
- if (isAppleOS) {
1516
+ if (isAppleOS (context) ) {
1516
1517
return _appleOSSelectButton (isSelected, asset);
1517
1518
} else {
1518
1519
return _androidSelectButton (isSelected, asset);
@@ -1522,7 +1523,7 @@ class FileAssetPickerViewerBuilderDelegate
1522
1523
);
1523
1524
},
1524
1525
),
1525
- if (! isAppleOS)
1526
+ if (! isAppleOS (context) )
1526
1527
Text (
1527
1528
textDelegate.select,
1528
1529
style: const TextStyle (fontSize: 18.0 ),
0 commit comments