DefaultAssetPickerBuilderDelegate class

Inheritance

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, AssetsChangeCallback<AssetPathEntity>? assetsChangeCallback, AssetsChangeRefreshPredicate<AssetPathEntity>? assetsChangeRefreshPredicate, Color? themeColor, AssetPickerTextDelegate? textDelegate, Locale? locale, ThumbnailSize gridThumbnailSize = defaultAssetGridPreviewSize, ThumbnailSize? previewThumbnailSize, SpecialPickerType? specialPickerType, bool keepScrollOffset = false, bool shouldAutoplayPreview = false})

Properties

appBarItemHeight double
Item's height in app bar. 顶栏内各个组件的统一高度
no setterinherited
appBarPreferredSize Size?
The preferred size of appBar. appBar 的首选大小。
getter/setter pairinherited
appleOSBlurRadius double
Blur radius in Apple OS layout mode. 苹果系列系统布局方式下的模糊度
no setterinherited
assetsChangeCallback AssetsChangeCallback<AssetPathEntity>?
The callback that will be called when the system notifies assets changes. 当系统通知资源变化时将调用的回调。
finalinherited
assetsChangeRefreshPredicate AssetsChangeRefreshPredicate<AssetPathEntity>?
Whether assets changing should call refresh with the given call and the current selected path. 判断资源变化是否根据 call 和当前选中的 path 进行更新。
finalinherited
bottomActionBarHeight double
Height for bottom action bar. 底部操作栏的高度
no setterinherited
bottomSectionHeight double
Height for the bottom occupied section. 底部区域占用的高度
no setterinherited
gridCount int
Assets count for the picker. 资源网格数
finalinherited
gridRevertKey GlobalKey<State<StatefulWidget>>
The GlobalKey for assetsGridBuilder to locate the ScrollView.center. assetsGridBuilder 用于定位 ScrollView.centerGlobalKey
finalinherited
gridScrollController ScrollController
The ScrollController for the preview grid.
finalinherited
gridThumbnailSize ThumbnailSize
Thumbnail size in the grid. 预览时网络的缩略图大小
final
hasBottomActions bool
Whether the bottom actions bar should display.
no setter
hashCode int
The hash code for this object.
no setterinherited
initialPermission PermissionState
The PermissionState when the picker is called. 当选择器被拉起时的权限状态
finalinherited
isPermissionLimited bool
Whether the permission is limited currently. 当前的权限是否为受限
no setterinherited
isPreviewEnabled bool
Whether the preview of assets is enabled. 资源的预览是否启用
no setter
isSingleAssetMode bool
Whether the picker is under the single asset mode. 选择器是否为单选模式
no setteroverride
isSwitchingPath ValueNotifier<bool>
If path switcher opened. 是否正在进行路径选择
finalinherited
isWeChatMoment bool
Whether the SpecialPickerType.wechatMoment is enabled. 当前是否为微信朋友圈选择模式
no setter
itemSpacing double
Space between assets item widget. 资源部件之间的间隔
no setterinherited
keepScrollOffset bool
Whether the picker should save the scroll offset between pushes and pops. 选择器是否可以从同样的位置开始选择
final
limitedPermissionOverlayPredicate LimitedPermissionOverlayPredicate?
Predicate whether the limited permission overlay should be displayed. 判断有限的权限情况下是否展示提示页面。
finalinherited
loadingIndicatorBuilder LoadingIndicatorBuilder?
Indicates the loading status for the builder. 指示目前加载的状态
finalinherited
onAssetsChangedLock Completer<void>?
Throttle the assets changing calls.
getter/setter pairinherited
overlayStyle SystemUiOverlayStyle
Return a system ui overlay style according to the brightness of the theme data. 根据主题返回状态栏的明暗样式
no setterinherited
pathNameBuilder PathNameBuilder<AssetPathEntity>?
Build customized path name. 构建自定义路径名称。
finalinherited
permission ValueNotifier<PermissionState>
no setterinherited
permissionLimitedBarHeight double
Height for the permission limited bar. 权限受限栏的高度
no setterinherited
permissionNotifier ValueNotifier<PermissionState>
Notifier for the current PermissionState. 当前 PermissionState 的监听
latefinalinherited
permissionOverlayDisplay ValueNotifier<bool>
latefinalinherited
pickerTheme ThemeData?
Theme for the picker. 选择器的主题
finalinherited
previewThumbnailSize ThumbnailSize?
Preview thumbnail size in the viewer. 预览时图片的缩略图大小
final
provider DefaultAssetPickerProvider
ChangeNotifier for asset picker. 资源选择器状态保持
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectPredicate AssetSelectPredicate<AssetEntity>?
Predicate whether an asset can be selected or unselected. 判断资源可否被选择。
finalinherited
semanticsTextDelegate AssetPickerTextDelegate
no setterinherited
shouldAutoplayPreview bool
Whether the preview should auto play. 预览是否自动播放
final
shouldBuildSpecialItem bool
Whether the delegate should build the special item. 是否需要构建自定义 item
no setterinherited
shouldRevertGrid bool?
Whether the assets grid should revert. 判断资源网格是否需要倒序排列
finalinherited
specialItemBuilder SpecialItemBuilder<AssetPathEntity>?
The widget builder for the the special item. 自定义 item 的构造方法
finalinherited
specialItemPosition SpecialItemPosition
Allow users set a special item in the picker with several positions. 允许用户在选择器中添加一个自定义 item,并指定位置
finalinherited
specialPickerType SpecialPickerType?
The current special picker type for the picker. 当前特殊选择类型
final
switchingPathCurve Curve
Curve when triggering path switching. 切换路径时的动画曲线
no setter
switchingPathDuration Duration
Duration when triggering path switching. 切换路径时的动画时长
no setter
textDelegate AssetPickerTextDelegate
no setterinherited
theme ThemeData
ThemeData for the picker. 选择器使用的主题
no setterinherited
themeColor Color?
Main color for the picker. 选择器的主题色
finalinherited

Methods

accessLimitedBottomTip(BuildContext context) Widget
The tip widget displays when the access is limited. 当访问受限时在底部展示的提示
override
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. 底部操作栏部件
override
build(BuildContext context) Widget
Yes, the build method. 没错,是它是它就是它,我们亲爱的 build 方法~
override
buildLivePhotoIndicator(BuildContext context, AssetEntity asset) Widget
inherited
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
effectiveShouldRevertGrid(BuildContext context) bool
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
isAppleOS(BuildContext context) bool
Whether the current platform is Apple OS. 当前平台是否苹果系列系统 (iOS & MacOS)
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
permissionOverlay(BuildContext context) Widget
The overlay when the permission is limited.
inherited
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

Operators

operator ==(Object other) bool
The equality operator.
inherited