itemBannedIndicator method

  1. @override
Widget itemBannedIndicator(
  1. BuildContext context,
  2. AssetEntity asset
)
override

Indicator when the asset cannot be selected. 当资源无法被选中时的遮罩

Implementation

@override
Widget itemBannedIndicator(BuildContext context, AssetEntity asset) {
  return Consumer<DefaultAssetPickerProvider>(
    builder: (_, DefaultAssetPickerProvider p, __) {
      final bool isDisabled =
          (!p.selectedAssets.contains(asset) && p.selectedMaximumAssets) ||
              (isWeChatMoment &&
                  asset.type == AssetType.video &&
                  p.selectedAssets.isNotEmpty);
      if (isDisabled) {
        return Container(
          color: theme.colorScheme.background.withOpacity(.85),
        );
      }
      return const SizedBox.shrink();
    },
  );
}