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 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, Color? themeColor, AssetPickerTextDelegate? textDelegate, Locale? locale})
Properties
- 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
-
isSwitchingPath
→ ValueNotifier<
bool> -
If path switcher opened.
是否正在进行路径选择
final
- itemSpacing → double
-
Space between assets item widget.
资源部件之间的间隔
no setter
- limitedPermissionOverlayPredicate → LimitedPermissionOverlayPredicate?
-
Predicate whether the limited permission overlay should be displayed.
判断有限的权限情况下是否展示提示页面。
final
- loadingIndicatorBuilder → LoadingIndicatorBuilder?
-
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
-
pathNameBuilder
→ PathNameBuilder<
AssetPathEntity> ? -
Build customized path name.
构建自定义路径名称。
final
-
permission
→ ValueNotifier<
PermissionState> -
Notifier for the current PermissionState.
当前 PermissionState 的监听
latefinal
- permissionLimitedBarHeight → double
-
Height for the permission limited bar.
权限受限栏的高度
no setter
-
permissionOverlayDisplay
→ ValueNotifier<
bool> -
latefinal
- pickerTheme → ThemeData?
-
Theme for the 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
- semanticsTextDelegate → AssetPickerTextDelegate
-
no setter
- shouldBuildSpecialItem → bool
-
Whether the delegate should build the special item.
是否需要构建自定义 item
no setter
- shouldRevertGrid → bool?
-
Whether the assets grid should revert.
判断资源网格是否需要倒序排列
final
-
specialItemBuilder
→ SpecialItemBuilder<
Path> ? -
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
- textDelegate → AssetPickerTextDelegate
-
no setter
- 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. 资源列表项的构建
-
assetGridItemSemanticsBuilder(
BuildContext context, int index, Asset asset, Widget child) → Widget - The Semantics 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. 网格实际的方向
-
emptyIndicator(
BuildContext context) → Widget - Indicator when no assets were found from the current path. 当前目录下无资源的显示
-
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. 图片和视频资源的部件构建
-
initState(
AssetPickerState< Asset, Path> state) → void -
Keep a
initState
method to sync with State. 保留一个initState
方法与 State 同步。 -
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. 当资源无法被选中时的遮罩
-
loadingIndicator(
BuildContext context) → Widget - Loading indicator. 加载指示器
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAssetsChanged(
MethodCall call, StateSetter setState) → Future< void> - Called when assets changed and obtained notifications from the OS. 系统发出资源变更的通知时调用的方法
-
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 List< PathWrapper< list, required int index}) → WidgetPath> > - Item widgets for path entity selector. 路径单独条目选择组件
-
previewButton(
BuildContext context) → Widget - Preview button to preview selected assets. 预览已选资源的按钮
-
selectAsset(
BuildContext context, Asset asset, int index, bool selected) → void - The method to select assets. Delegates can implement this method to involve with predications, callbacks, etc. 选择资源的方法。自定义的 delegate 可以通过实现该方法,整合判断、回调等操作。
-
selectedBackdrop(
BuildContext context, int index, Asset asset) → Widget - Animated backdrop widget for items. 部件选中时的动画遮罩部件
-
selectIndicator(
BuildContext context, int index, 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. 视频类型资源指示
-
viewAsset(
BuildContext context, int index, AssetEntity currentAsset) → Future< void> - Determine how to browse assets in the viewer. 定义如何在查看器中浏览资源
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited