DefaultAssetPickerBuilderDelegate class

Inheritance

Constructors

DefaultAssetPickerBuilderDelegate({required DefaultAssetPickerProvider 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<AssetEntity>? selectPredicate, bool? shouldRevertGrid, int gridThumbSize = Constants.defaultGridThumbSize, List<int>? previewThumbSize, SpecialPickerType? specialPickerType})

Properties

allowSpecialItemWhenEmpty bool
Whether the special item will display or not when assets is empty. 当没有资源时是否显示自定义item
finalinherited
appBarItemHeight double
Item's height in app bar. 顶栏内各个组件的统一高度
no setterinherited
appleOSBlurRadius double
Blur radius in Apple OS layout mode. 苹果系列系统布局方式下的模糊度
no setterinherited
bottomActionBarHeight double
Height for bottom action bar. 底部操作栏的高度
no setterinherited
bottomSectionHeight double
Height for the bottom occupied section. 底部区域占用的高度
no setterinherited
effectiveShouldRevertGrid bool
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
gridThumbSize int
Thumbnail size in the grid. 预览时网络的缩略图大小
final
hashCode int
The hash code for this object.
no setterinherited
initialPermission PermissionState
The PermissionState when the picker is called. 当选择器被拉起时的权限状态
finalinherited
isAppleOS bool
Whether the current platform is Apple OS. 当前平台是否苹果系列系统 (iOS & MacOS)
no setterinherited
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 setterinherited
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. 选择器是否可以从同样的位置开始选择
finalinherited
loadingIndicatorBuilder IndicatorBuilder?
Indicates the loading status for the builder. 指示目前加载的状态
finalinherited
overlayStyle SystemUiOverlayStyle
Return a system ui overlay style according to the brightness of the theme data. 根据主题返回状态栏的明暗样式
no setterinherited
permission ValueNotifier<PermissionState>
Notifier for the current PermissionState. 当前 PermissionState 的监听
latefinalinherited
permissionLimitedBarHeight double
Height for the permission limited bar. 权限受限栏的高度
no setterinherited
permissionOverlayHidden ValueNotifier<bool>
finalinherited
pickerTheme ThemeData?
Theme for the picker. 选择器的主题
finalinherited
previewThumbSize List<int>?
Preview thumbnail size in the viewer. 预览时图片的缩略图大小
final
provider AssetPickerProvider<AssetEntity, AssetPathEntity>
ChangeNotifier for asset picker. 资源选择器状态保持
finalinherited
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
shouldRevertGrid bool?
Whether the assets grid should revert. 判断资源网格是否需要倒序排列
finalinherited
specialItemBuilder WidgetBuilder?
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
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. 当访问受限时在底部展示的提示
inherited
androidLayout(BuildContext context) Widget
Layout for Android devices. Android设备的选择器布局
override
appBar(BuildContext context) PreferredSizeWidget
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
There are several conditions within this builder:
override
assetsGridBuilder(BuildContext context) Widget
The main grid view builder for assets. 主要的资源查看网格部件
override
assetsGridItemCount({required BuildContext context, required List<AssetEntity> assets, int placeholderCount = 0}) 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 方法~
inherited
confirmButton(BuildContext context) Widget
It'll pop with AssetPickerProvider.selectedAssets when there are any assets were chosen. 当有资源已选时,点击按钮将把已选资源通过路由返回。
override
dispose() → void
Keep a dispose method to sync with State. 保留一个 dispose 方法与 State 同步。
inherited
effectiveGridDirection(BuildContext context) TextDirection
The effective direction for the assets grid. 网格实际的方向
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
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 位置的监听。
inherited
loadingIndicator(BuildContext context) Widget
Loading indicator. 加载指示器
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
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 Map<AssetPathEntity, Uint8List?> list, required int index, bool isAudio = false}) Widget
Item widgets for path entity selector. 路径单独条目选择组件
override
previewButton(BuildContext context) Widget
Preview button to preview selected assets. 预览已选资源的按钮
override
selectedBackdrop(BuildContext context, int index, AssetEntity asset) Widget
Animated backdrop widget for items. 部件选中时的动画遮罩部件
override
selectIndicator(BuildContext context, AssetEntity asset) Widget
Indicator for assets selected status. 资源是否已选的指示器
override
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

Operators

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