DefaultAssetPickerBuilderDelegate class
Constructors
-
DefaultAssetPickerBuilderDelegate({required DefaultAssetPickerProvider provider, required PermissionState initialPermission, int gridCount = 4, ThemeData? pickerTheme, SpecialItemPosition specialItemPosition = SpecialItemPosition.none, SpecialItemBuilder<AssetPathEntity>? specialItemBuilder, LoadingIndicatorBuilder? loadingIndicatorBuilder, AssetSelectPredicate<AssetEntity>? selectPredicate, bool? shouldRevertGrid, LimitedPermissionOverlayPredicate? limitedPermissionOverlayPredicate, PathNameBuilder<AssetPathEntity>? pathNameBuilder, Color? themeColor, AssetPickerTextDelegate? textDelegate, Locale? locale, ThumbnailSize gridThumbnailSize = defaultAssetGridPreviewSize, ThumbnailSize? previewThumbnailSize, SpecialPickerType? specialPickerType, bool keepScrollOffset = false})
-
Methods
-
accessLimitedBottomTip(BuildContext context)
→ Widget
-
The tip widget displays when the access is limited.
当访问受限时在底部展示的提示
inherited
-
androidLayout(BuildContext context)
→ Widget
-
Layout for Android devices.
Android设备的选择器布局
override
-
appBar(BuildContext context)
→ AssetPickerAppBar
-
Custom app bar for the picker.
选择器自定义的顶栏
override
-
appleOSLayout(BuildContext context)
→ Widget
-
Layout for Apple OS devices.
苹果系列设备的选择器布局
override
-
assetGridItemBuilder(BuildContext context, int index, List<AssetEntity> currentAssets, {Widget? specialItem})
→ Widget
-
There are several conditions within this builder:
override
-
assetGridItemSemanticsBuilder(BuildContext context, int index, AssetEntity asset, Widget child)
→ Widget
-
The Semantics builder for the assets' grid.
资源列表项的语义构建
override
-
assetsGridBuilder(BuildContext context)
→ Widget
-
The main grid view builder for assets.
主要的资源查看网格部件
override
-
assetsGridItemCount({required BuildContext context, required List<AssetEntity> assets, int placeholderCount = 0, Widget? specialItem})
→ int
-
The function which return items count for the assets' grid.
为资源列表提供内容数量计算的方法
override
-
audioIndicator(BuildContext context, AssetEntity asset)
→ Widget
-
Audio asset type indicator.
音频类型资源指示
override
-
audioItemBuilder(BuildContext context, int index, AssetEntity asset)
→ Widget
-
The item builder for audio type of asset.
音频资源的部件构建
override
-
backButton(BuildContext context)
→ Widget
-
Back button.
返回按钮
inherited
-
bottomActionBar(BuildContext context)
→ Widget
-
Action bar widget aligned to bottom.
底部操作栏部件
inherited
-
build(BuildContext context)
→ Widget
-
Yes, the build method.
没错,是它是它就是它,我们亲爱的 build 方法~
override
-
confirmButton(BuildContext context)
→ Widget
-
It'll pop with AssetPickerProvider.selectedAssets
when there are any assets were chosen.
当有资源已选时,点击按钮将把已选资源通过路由返回。
override
-
dispose()
→ void
-
Be aware that the method will do nothing when keepScrollOffset is true.
注意当 keepScrollOffset 为 true 时方法不会进行释放。
override
-
effectiveGridDirection(BuildContext context)
→ TextDirection
-
The effective direction for the assets grid.
网格实际的方向
inherited
-
emptyIndicator(BuildContext context)
→ Widget
-
Indicator when no assets were found from the current path.
当前目录下无资源的显示
inherited
-
failedItemBuilder(BuildContext context)
→ Widget
-
Item widgets when the thumb data load failed.
资源缩略数据加载失败时使用的部件
inherited
-
findChildIndexBuilder({required String id, required List<AssetEntity> assets, int placeholderCount = 0})
→ int
-
Indicates how would the grid found a reusable RenderObject through
id
.
为 Grid 布局指示如何找到可复用的 RenderObject。
override
-
gifIndicator(BuildContext context, AssetEntity asset)
→ Widget
-
GIF image type indicator.
GIF 类型图片指示
inherited
-
imageAndVideoItemBuilder(BuildContext context, int index, AssetEntity asset)
→ Widget
-
The item builder for images and video type of asset.
图片和视频资源的部件构建
override
-
initState(AssetPickerState<AssetEntity, AssetPathEntity> state)
→ void
-
Keep a
initState
method to sync with State.
保留一个 initState
方法与 State 同步。
inherited
-
interactiveTextColor(BuildContext context)
→ Color
-
The color for interactive texts.
可交互的文字的颜色
inherited
-
iOSPermissionOverlay(BuildContext context)
→ Widget
-
The overlay when the permission is limited on iOS.
inherited
-
itemBannedIndicator(BuildContext context, AssetEntity asset)
→ Widget
-
Indicator when the asset cannot be selected.
当资源无法被选中时的遮罩
override
-
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.
加载指示器
override
-
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.
系统发出资源变更的通知时调用的方法
override
-
pathEntityListBackdrop(BuildContext context)
→ Widget
-
While the picker is switching path, this will displayed.
If the user tapped on it, it'll collapse the list widget.
override
-
pathEntityListWidget(BuildContext context)
→ Widget
-
List widget for path entities.
路径选择列表组件
override
-
pathEntitySelector(BuildContext context)
→ Widget
-
Path entity select widget builder.
路径选择部件构建
override
-
pathEntityWidget({required BuildContext context, required List<PathWrapper<AssetPathEntity>> list, required int index})
→ Widget
-
Item widgets for path entity selector.
路径单独条目选择组件
override
-
previewButton(BuildContext context)
→ Widget
-
Preview button to preview selected assets.
预览已选资源的按钮
override
-
selectAsset(BuildContext context, AssetEntity asset, int index, bool selected)
→ Future<void>
-
The method to select assets. Delegates can implement this method
to involve with predications, callbacks, etc.
选择资源的方法。自定义的 delegate 可以通过实现该方法,整合判断、回调等操作。
override
-
selectedBackdrop(BuildContext context, int index, AssetEntity asset)
→ Widget
-
Animated backdrop widget for items.
部件选中时的动画遮罩部件
override
-
selectIndicator(BuildContext context, int index, AssetEntity asset)
→ Widget
-
Indicator for assets selected status.
资源是否已选的指示器
override
-
semanticIndex(int index)
→ int
-
-
toString()
→ String
-
A string representation of this object.
inherited
-
videoIndicator(BuildContext context, AssetEntity asset)
→ Widget
-
Videos often contains various of color in the cover,
so in order to keep the content visible in most cases,
the color of the indicator has been set to Colors.white.
override
-
viewAsset(BuildContext context, int index, AssetEntity currentAsset)
→ Future<void>
-
Determine how to browse assets in the viewer.
定义如何在查看器中浏览资源
override