@@ -125,9 +125,9 @@ class AssetPicker extends StatelessWidget {
125
125
}
126
126
}
127
127
128
- /// Whether the current platform is iOS .
129
- /// 当前平台是否iOS
130
- bool get isIOS => Platform .isIOS;
128
+ /// Whether the current platform is Apple OS .
129
+ /// 当前平台是否苹果系列系统 (iOS & MacOS)
130
+ bool get isAppleOS => Platform .isIOS || Platform .isMacOS ;
131
131
132
132
/// Space between asset item widget [_succeedItem] .
133
133
/// 资源部件之间的间隔
@@ -141,9 +141,9 @@ class AssetPicker extends StatelessWidget {
141
141
/// 底部操作栏的高度
142
142
double get bottomActionBarHeight => kToolbarHeight / 1.1 ;
143
143
144
- /// Blur radius in iOS layout mode.
145
- /// iOS布局方式下的模糊度
146
- double get iOSBlurRadius => 15.0 ;
144
+ /// Blur radius in Apple OS layout mode.
145
+ /// 苹果系列系统布局方式下的模糊度
146
+ double get appleOSBlurRadius => 15.0 ;
147
147
148
148
/// [Curve] when triggering path switching.
149
149
/// 切换路径时的动画曲线
@@ -249,7 +249,7 @@ class AssetPicker extends StatelessWidget {
249
249
splashFactory: InkSplash .splashFactory,
250
250
onTap: () => provider.switchPath (pathEntity),
251
251
child: SizedBox (
252
- height: isIOS ? 64.0 : 52.0 ,
252
+ height: isAppleOS ? 64.0 : 52.0 ,
253
253
child: Row (
254
254
children: < Widget > [
255
255
RepaintBoundary (
@@ -339,21 +339,21 @@ class AssetPicker extends StatelessWidget {
339
339
Widget get pathEntityListWidget {
340
340
final double appBarHeight = kToolbarHeight + Screens .topSafeHeight;
341
341
final double maxHeight =
342
- isIOS ? Screens .height - appBarHeight : Screens .height * 0.75 ;
342
+ isAppleOS ? Screens .height - appBarHeight : Screens .height * 0.75 ;
343
343
return Selector <AssetPickerProvider , bool >(
344
344
selector: (BuildContext _, AssetPickerProvider provider) =>
345
345
provider.isSwitchingPath,
346
346
builder: (BuildContext _, bool isSwitchingPath, Widget __) {
347
347
return AnimatedPositioned (
348
348
duration: switchingPathDuration,
349
349
curve: switchingPathCurve,
350
- top: isIOS
350
+ top: isAppleOS
351
351
? ! isSwitchingPath ? - maxHeight : appBarHeight
352
352
: - (! isSwitchingPath ? maxHeight : 1.0 ),
353
353
child: AnimatedOpacity (
354
354
duration: switchingPathDuration,
355
355
curve: switchingPathCurve,
356
- opacity: ! isIOS || isSwitchingPath ? 1.0 : 0.0 ,
356
+ opacity: ! isAppleOS || isSwitchingPath ? 1.0 : 0.0 ,
357
357
child: Container (
358
358
width: Screens .width,
359
359
height: maxHeight,
@@ -493,7 +493,7 @@ class AssetPicker extends StatelessWidget {
493
493
horizontal: 2.0 ,
494
494
vertical: 2.0 ,
495
495
),
496
- decoration: ! isIOS
496
+ decoration: ! isAppleOS
497
497
? BoxDecoration (
498
498
borderRadius: BorderRadius .circular (2.0 ),
499
499
color: theme.iconTheme.color.withOpacity (0.75 ),
@@ -502,11 +502,11 @@ class AssetPicker extends StatelessWidget {
502
502
child: Text (
503
503
Constants .textDelegate.gifIndicator,
504
504
style: TextStyle (
505
- color: isIOS
505
+ color: isAppleOS
506
506
? theme.textTheme.bodyText2.color
507
507
: theme.primaryColor,
508
- fontSize: isIOS ? 14.0 : 12.0 ,
509
- fontWeight: isIOS ? FontWeight .w500 : FontWeight .normal,
508
+ fontSize: isAppleOS ? 14.0 : 12.0 ,
509
+ fontWeight: isAppleOS ? FontWeight .w500 : FontWeight .normal,
510
510
),
511
511
),
512
512
),
@@ -599,9 +599,9 @@ class AssetPicker extends StatelessWidget {
599
599
},
600
600
child: AnimatedContainer (
601
601
duration: switchingPathDuration,
602
- margin: EdgeInsets .all (isIOS ? 10.0 : 6.0 ),
603
- width: isIOS ? 28.0 : 20.0 ,
604
- height: isIOS ? 28.0 : 20.0 ,
602
+ margin: EdgeInsets .all (isAppleOS ? 10.0 : 6.0 ),
603
+ width: isAppleOS ? 28.0 : 20.0 ,
604
+ height: isAppleOS ? 28.0 : 20.0 ,
605
605
decoration: BoxDecoration (
606
606
border: ! selected
607
607
? Border .all (color: Colors .white, width: 2.0 )
@@ -617,9 +617,9 @@ class AssetPicker extends StatelessWidget {
617
617
'${selectedAssets .toList ().indexOf (asset ) + 1 }' ,
618
618
style: TextStyle (
619
619
color: Colors .white,
620
- fontSize: isIOS ? 16.0 : 14.0 ,
620
+ fontSize: isAppleOS ? 16.0 : 14.0 ,
621
621
fontWeight:
622
- isIOS ? FontWeight .w600 : FontWeight .normal,
622
+ isAppleOS ? FontWeight .w600 : FontWeight .normal,
623
623
),
624
624
)
625
625
: const SizedBox .shrink (),
@@ -656,7 +656,7 @@ class AssetPicker extends StatelessWidget {
656
656
Widget __,
657
657
) {
658
658
return GridView .builder (
659
- padding: isIOS
659
+ padding: isAppleOS
660
660
? EdgeInsets .only (
661
661
top: Screens .topSafeHeight + kToolbarHeight,
662
662
bottom: bottomActionBarHeight,
@@ -782,18 +782,18 @@ class AssetPicker extends StatelessWidget {
782
782
right: 20.0 ,
783
783
bottom: Screens .bottomSafeHeight,
784
784
),
785
- color: theme.primaryColor.withOpacity (isIOS ? 0.90 : 1.0 ),
785
+ color: theme.primaryColor.withOpacity (isAppleOS ? 0.90 : 1.0 ),
786
786
child: Row (children: < Widget > [
787
787
previewButton (context),
788
- if (isIOS ) const Spacer (),
789
- if (isIOS ) confirmButton (context),
788
+ if (isAppleOS ) const Spacer (),
789
+ if (isAppleOS ) confirmButton (context),
790
790
]),
791
791
);
792
- if (isIOS ) {
792
+ if (isAppleOS ) {
793
793
child = ClipRect (
794
794
child: BackdropFilter (
795
795
filter:
796
- ui.ImageFilter .blur (sigmaX: iOSBlurRadius , sigmaY: iOSBlurRadius ),
796
+ ui.ImageFilter .blur (sigmaX: appleOSBlurRadius , sigmaY: appleOSBlurRadius ),
797
797
child: child,
798
798
),
799
799
);
@@ -805,11 +805,11 @@ class AssetPicker extends StatelessWidget {
805
805
/// 返回按钮
806
806
Widget backButton (BuildContext context) => Padding (
807
807
padding: const EdgeInsets .symmetric (vertical: 4.0 ),
808
- child: isIOS
808
+ child: isAppleOS
809
809
? GestureDetector (
810
810
onTap: Navigator .of (context).maybePop,
811
811
child: Container (
812
- margin: isIOS
812
+ margin: isAppleOS
813
813
? const EdgeInsets .symmetric (horizontal: 20.0 )
814
814
: null ,
815
815
child: IntrinsicWidth (
@@ -828,9 +828,9 @@ class AssetPicker extends StatelessWidget {
828
828
),
829
829
);
830
830
831
- /// Layout for iOS devices.
832
- /// iOS设备的选择器布局
833
- Widget iOSLayout (BuildContext context) {
831
+ /// Layout for Apple OS devices.
832
+ /// 苹果系列设备的选择器布局
833
+ Widget appleOSLayout (BuildContext context) {
834
834
return Stack (
835
835
children: < Widget > [
836
836
Positioned .fill (
@@ -868,7 +868,7 @@ class AssetPicker extends StatelessWidget {
868
868
title: pathEntitySelector,
869
869
leading: backButton (context),
870
870
actionsPadding: const EdgeInsets .only (right: 14.0 ),
871
- blurRadius: iOSBlurRadius ,
871
+ blurRadius: appleOSBlurRadius ,
872
872
),
873
873
],
874
874
);
@@ -923,7 +923,7 @@ class AssetPicker extends StatelessWidget {
923
923
value: provider,
924
924
child: Material (
925
925
color: theme.canvasColor,
926
- child: isIOS ? iOSLayout (context) : androidLayout (context),
926
+ child: isAppleOS ? appleOSLayout (context) : androidLayout (context),
927
927
),
928
928
),
929
929
),
0 commit comments