AssetPickerBuilderDelegate<Asset, Path> class
abstract
The delegate to build the whole picker's components.
By extending the delegate, you can customize every components on you own. Delegate requires two generic types:
Asset
The type of your assets. Defaults to AssetEntity.Path
The type of your paths. Defaults to AssetPathEntity.
Constructors
-
AssetPickerBuilderDelegate({required AssetPickerProvider<
Asset, Path> provider, required PermissionState initialPermission, int gridCount = 4, Color? themeColor, AssetsPickerTextDelegate? textDelegate, ThemeData? pickerTheme, SpecialItemPosition specialItemPosition = SpecialItemPosition.none, WidgetBuilder? specialItemBuilder, IndicatorBuilder? loadingIndicatorBuilder, bool allowSpecialItemWhenEmpty = false, bool keepScrollOffset = false, AssetSelectPredicate<Asset> ? selectPredicate, bool? shouldRevertGrid})
Properties
- allowSpecialItemWhenEmpty → bool
-
Whether the special item will display or not when assets is empty.
当没有资源时是否显示自定义item
final
- appBarItemHeight → double
-
Item's height in app bar.
顶栏内各个组件的统一高度
no setter
- appleOSBlurRadius → double
-
Blur radius in Apple OS layout mode.
苹果系列系统布局方式下的模糊度
no setter
- bottomActionBarHeight → double
-
Height for bottom action bar.
底部操作栏的高度
no setter
- bottomSectionHeight → double
-
Height for the bottom occupied section.
底部区域占用的高度
no setter
- effectiveShouldRevertGrid → bool
-
no setter
- gridCount → int
-
Assets count for the picker.
资源网格数
final
-
gridRevertKey
→ GlobalKey<
State< StatefulWidget> > -
The GlobalKey for assetsGridBuilder to locate the ScrollView.center.
assetsGridBuilder 用于定位 ScrollView.center 的 GlobalKey
final
- gridScrollController → ScrollController
-
The ScrollController for the preview grid.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialPermission → PermissionState
-
The PermissionState when the picker is called.
当选择器被拉起时的权限状态
final
- isAppleOS → bool
-
Whether the current platform is Apple OS.
当前平台是否苹果系列系统 (iOS & MacOS)
no setter
- isPermissionLimited → bool
-
Whether the permission is limited currently.
当前的权限是否为受限
no setter
- isSingleAssetMode → bool
-
Whether the picker is under the single asset mode.
选择器是否为单选模式
no setter
- itemSpacing → double
-
Space between assets item widget.
资源部件之间的间隔
no setter
- keepScrollOffset → bool
-
Whether the picker should save the scroll offset between pushes and pops.
选择器是否可以从同样的位置开始选择
final
- loadingIndicatorBuilder → IndicatorBuilder?
-
Indicates the loading status for the builder.
指示目前加载的状态
final
- overlayStyle → SystemUiOverlayStyle
-
Return a system ui overlay style according to
the brightness of the theme data.
根据主题返回状态栏的明暗样式
no setter
-
permission
→ ValueNotifier<
PermissionState> -
Notifier for the current PermissionState.
当前 PermissionState 的监听
latefinal
- permissionLimitedBarHeight → double
-
Height for the permission limited bar.
权限受限栏的高度
no setter
-
permissionOverlayHidden
→ ValueNotifier<
bool> -
final
- pickerTheme → ThemeData?
-
Theme for the picker.
选择器的主题
final
-
provider
→ AssetPickerProvider<
Asset, Path> -
ChangeNotifier for asset picker.
资源选择器状态保持
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectPredicate
→ AssetSelectPredicate<
Asset> ? -
Predicate whether an asset can be selected or unselected.
判断资源可否被选择
final
- shouldRevertGrid → bool?
-
Whether the assets grid should revert.
判断资源网格是否需要倒序排列
final
- specialItemBuilder → WidgetBuilder?
-
The widget builder for the the special item.
自定义item的构造方法
final
- specialItemPosition → SpecialItemPosition
-
Allow users set a special item in the picker with several positions.
允许用户在选择器中添加一个自定义item,并指定位置
final
- theme → ThemeData
-
ThemeData for the picker.
选择器使用的主题
no setter
- themeColor → Color
-
Main color for the picker.
选择器的主题色
final
Methods
-
accessLimitedBottomTip(
BuildContext context) → Widget - The tip widget displays when the access is limited. 当访问受限时在底部展示的提示
-
androidLayout(
BuildContext context) → Widget - Layout for Android devices. Android设备的选择器布局
-
appBar(
BuildContext context) → PreferredSizeWidget - Custom app bar for the picker. 选择器自定义的顶栏
-
appleOSLayout(
BuildContext context) → Widget - Layout for Apple OS devices. 苹果系列设备的选择器布局
-
assetGridItemBuilder(
BuildContext context, int index, List< Asset> currentAssets) → Widget - The item builder for the assets' grid. 资源列表项的构建
-
assetsGridBuilder(
BuildContext context) → Widget - The main grid view builder for assets. 主要的资源查看网格部件
-
assetsGridItemCount(
{required BuildContext context, required List< Asset> assets, int placeholderCount = 0}) → int - The function which return items count for the assets' grid. 为资源列表提供内容数量计算的方法
-
audioIndicator(
BuildContext context, Asset asset) → Widget - Audio asset type indicator. 音频类型资源指示
-
audioItemBuilder(
BuildContext context, int index, Asset asset) → Widget - The item builder for audio type of asset. 音频资源的部件构建
-
backButton(
BuildContext context) → Widget - Back button. 返回按钮
-
bottomActionBar(
BuildContext context) → Widget - Action bar widget aligned to bottom. 底部操作栏部件
-
build(
BuildContext context) → Widget - Yes, the build method. 没错,是它是它就是它,我们亲爱的 build 方法~
-
confirmButton(
BuildContext context) → Widget - Confirm button. 确认按钮
-
dispose(
) → void - Keep a dispose method to sync with State. 保留一个 dispose 方法与 State 同步。
-
effectiveGridDirection(
BuildContext context) → TextDirection - The effective direction for the assets grid. 网格实际的方向
-
failedItemBuilder(
BuildContext context) → Widget - Item widgets when the thumb data load failed. 资源缩略数据加载失败时使用的部件
-
findChildIndexBuilder(
{required String id, required List< Asset> assets, int placeholderCount = 0}) → int? -
Indicates how would the grid found a reusable RenderObject through
id
. 为 Grid 布局指示如何找到可复用的 RenderObject。 -
gifIndicator(
BuildContext context, Asset asset) → Widget - GIF image type indicator. GIF 类型图片指示
-
imageAndVideoItemBuilder(
BuildContext context, int index, Asset asset) → Widget - The item builder for images and video type of asset. 图片和视频资源的部件构建
-
interactiveTextColor(
BuildContext context) → Color - The color for interactive texts. 可交互的文字的颜色
-
iOSPermissionOverlay(
BuildContext context) → Widget - The overlay when the permission is limited on iOS.
-
itemBannedIndicator(
BuildContext context, Asset asset) → Widget - Indicator when the asset cannot be selected. 当资源无法被选中时的遮罩
-
keepScrollOffsetListener(
) → void - The listener to track the scroll position of the gridScrollController if keepScrollOffset is true. 当 keepScrollOffset 为 true 时,跟踪 gridScrollController 位置的监听。
-
loadingIndicator(
BuildContext context) → Widget - Loading indicator. 加载指示器
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pathEntityListBackdrop(
BuildContext context) → Widget - A backdrop widget behind the pathEntityListWidget. 在 pathEntityListWidget 后面的遮罩层
-
pathEntityListWidget(
BuildContext context) → Widget - List widget for path entities. 路径选择列表组件
-
pathEntitySelector(
BuildContext context) → Widget - Path entity select widget builder. 路径选择部件构建
-
pathEntityWidget(
{required BuildContext context, required Map< Path, Uint8List?> list, required int index, bool isAudio = false}) → Widget - Item widgets for path entity selector. 路径单独条目选择组件
-
previewButton(
BuildContext context) → Widget - Preview button to preview selected assets. 预览已选资源的按钮
-
selectedBackdrop(
BuildContext context, int index, Asset asset) → Widget - Animated backdrop widget for items. 部件选中时的动画遮罩部件
-
selectIndicator(
BuildContext context, Asset asset) → Widget - Indicator for assets selected status. 资源是否已选的指示器
-
toString(
) → String -
A string representation of this object.
inherited
-
videoIndicator(
BuildContext context, Asset asset) → Widget - Video asset type indicator. 视频类型资源指示
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited