AssetPickerBuilderDelegate<Asset, Path> constructor
AssetPickerBuilderDelegate<Asset, Path> ({
- required PermissionState initialPermission,
- int gridCount = 4,
- ThemeData? pickerTheme,
- SpecialItemPosition specialItemPosition = SpecialItemPosition.none,
- SpecialItemBuilder<
Path> ? specialItemBuilder, - LoadingIndicatorBuilder? loadingIndicatorBuilder,
- AssetSelectPredicate<
Asset> ? selectPredicate, - bool? shouldRevertGrid,
- LimitedPermissionOverlayPredicate? limitedPermissionOverlayPredicate,
- PathNameBuilder<
AssetPathEntity> ? pathNameBuilder, - AssetsChangeCallback<
AssetPathEntity> ? assetsChangeCallback, - AssetsChangeRefreshPredicate<
AssetPathEntity> ? assetsChangeRefreshPredicate, - Color? themeColor,
- AssetPickerTextDelegate? textDelegate,
- Locale? locale,
Implementation
AssetPickerBuilderDelegate({
required this.initialPermission,
this.gridCount = 4,
this.pickerTheme,
this.specialItemPosition = SpecialItemPosition.none,
this.specialItemBuilder,
this.loadingIndicatorBuilder,
this.selectPredicate,
this.shouldRevertGrid,
this.limitedPermissionOverlayPredicate,
this.pathNameBuilder,
this.assetsChangeCallback,
this.assetsChangeRefreshPredicate,
Color? themeColor,
AssetPickerTextDelegate? textDelegate,
Locale? locale,
}) : assert(gridCount > 0, 'gridCount must be greater than 0.'),
assert(
pickerTheme == null || themeColor == null,
'Theme and theme color cannot be set at the same time.',
),
themeColor = pickerTheme?.colorScheme.secondary ??
themeColor ??
defaultThemeColorWeChat {
Singleton.textDelegate =
textDelegate ?? assetPickerTextDelegateFromLocale(locale);
}