loadingIndicator method
Loading indicator. 加载指示器
Subclasses need to implement this due to the generic type limitation, and not all delegates use AssetPickerProvider.
See also:
- DefaultAssetPickerBuilderDelegate.loadingIndicator as an example.
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: context.mediaQuery.size.width / gridCount / 3,
),
);
}