loadingIndicator method

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

Loading indicator. 加载指示器

Subclasses need to implement this due to the generic type limitation, and not all delegates use AssetPickerProvider.

See also:

Implementation

@override
Widget loadingIndicator(BuildContext context) {
  return Selector<DefaultAssetPickerProvider, bool>(
    selector: (_, DefaultAssetPickerProvider p) => p.isAssetsEmpty,
    builder: (BuildContext context, bool isAssetsEmpty, Widget? w) {
      if (loadingIndicatorBuilder != null) {
        return loadingIndicatorBuilder!(context, isAssetsEmpty);
      }
      return Center(child: isAssetsEmpty ? emptyIndicator(context) : w);
    },
    child: PlatformProgressIndicator(
      color: theme.iconTheme.color,
      size: MediaQuery.sizeOf(context).width / gridCount / 3,
    ),
  );
}