pathEntityListBackdrop method

  1. @override
Widget pathEntityListBackdrop(
  1. BuildContext context
)
override

While the picker is switching path, this will displayed. If the user tapped on it, it'll collapse the list widget.

当选择器正在选择路径时,它会出现。用户点击它时,列表会折叠收起。

Implementation

@override
Widget pathEntityListBackdrop(BuildContext context) {
  return Selector<DefaultAssetPickerProvider, bool>(
    selector: (_, DefaultAssetPickerProvider p) => p.isSwitchingPath,
    builder: (BuildContext context, bool isSwitchingPath, __) {
      return IgnorePointer(
        ignoring: !isSwitchingPath,
        child: GestureDetector(
          onTap: () => provider.isSwitchingPath = false,
          child: AnimatedOpacity(
            duration: switchingPathDuration,
            opacity: isSwitchingPath ? 1.0 : 0.0,
            child: Container(color: Colors.black.withOpacity(0.75)),
          ),
        ),
      );
    },
  );
}