@@ -454,12 +454,41 @@ class AssetPicker extends StatelessWidget {
454
454
);
455
455
}
456
456
457
+ /// A backdrop widget behind the [pathEntityListWidget] .
458
+ /// 在 [pathEntityListWidget] 后面的遮罩层
459
+ ///
460
+ /// While the picker is switching path, this will displayed.
461
+ /// If the user tapped on it, it'll collapse the list widget.
462
+ ///
463
+ /// 当选择器正在选择路径时,它会出现。用户点击它时,列表会折叠收起。
464
+ Widget get pathEntityListBackdrop {
465
+ return Selector <AssetPickerProvider , bool >(
466
+ selector: (BuildContext _, AssetPickerProvider provider) =>
467
+ provider.isSwitchingPath,
468
+ builder: (BuildContext _, bool isSwitchingPath, Widget __) {
469
+ return IgnorePointer (
470
+ ignoring: ! isSwitchingPath,
471
+ child: GestureDetector (
472
+ onTap: () {
473
+ _.read <AssetPickerProvider >().isSwitchingPath = false ;
474
+ },
475
+ child: AnimatedOpacity (
476
+ duration: switchingPathDuration,
477
+ opacity: isSwitchingPath ? 1.0 : 0.0 ,
478
+ child: Container (color: Colors .black.withOpacity (0.75 )),
479
+ ),
480
+ ),
481
+ );
482
+ },
483
+ );
484
+ }
485
+
457
486
/// List widget for path entities.
458
487
/// 路径选择列表组件
459
488
Widget get pathEntityListWidget {
460
489
final double appBarHeight = kToolbarHeight + Screens .topSafeHeight;
461
490
final double maxHeight =
462
- isAppleOS ? Screens .height - appBarHeight : Screens .height * 0.75 ;
491
+ isAppleOS ? Screens .height - appBarHeight : Screens .height * 0.825 ;
463
492
return Selector <AssetPickerProvider , bool >(
464
493
selector: (BuildContext _, AssetPickerProvider provider) =>
465
494
provider.isSwitchingPath,
@@ -1273,6 +1302,7 @@ class AssetPicker extends StatelessWidget {
1273
1302
],
1274
1303
),
1275
1304
),
1305
+ pathEntityListBackdrop,
1276
1306
pathEntityListWidget,
1277
1307
],
1278
1308
)
0 commit comments