appleOSLayout method

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

Layout for Apple OS devices. 苹果系列设备的选择器布局

Implementation

@override
Widget appleOSLayout(BuildContext context) {
  return Stack(
    children: <Widget>[
      Positioned.fill(
        child: Selector<DefaultAssetPickerProvider, bool>(
          selector: (_, DefaultAssetPickerProvider p) => p.hasAssetsToDisplay,
          builder: (_, bool hasAssetsToDisplay, __) {
            final Widget _child;
            final bool shouldDisplayAssets = hasAssetsToDisplay ||
                (allowSpecialItemWhenEmpty &&
                    specialItemPosition != SpecialItemPosition.none);
            if (shouldDisplayAssets) {
              _child = Stack(
                children: <Widget>[
                  RepaintBoundary(
                    child: Stack(
                      children: <Widget>[
                        Positioned.fill(
                          child: assetsGridBuilder(context),
                        ),
                        if ((!isSingleAssetMode || isAppleOS) &&
                            isPreviewEnabled)
                          Positioned.fill(
                            top: null,
                            child: bottomActionBar(context),
                          ),
                      ],
                    ),
                  ),
                  pathEntityListBackdrop(context),
                  pathEntityListWidget(context),
                ],
              );
            } else {
              _child = loadingIndicator(context);
            }
            return AnimatedSwitcher(
              duration: switchingPathDuration,
              child: _child,
            );
          },
        ),
      ),
      appBar(context),
    ],
  );
}