DefaultAssetPickerProvider class

The default implementation of the AssetPickerProvider for the picker. The Asset is AssetEntity, and the Path is AssetPathEntity.

Inheritance

Constructors

DefaultAssetPickerProvider({List<AssetEntity>? selectedAssets, int maxAssets = defaultMaxAssetsCount, int pageSize = defaultAssetsPerPage, ThumbnailSize pathThumbnailSize = defaultPathThumbnailSize, RequestType requestType = RequestType.image, SortPathDelegate<AssetPathEntity>? sortPathDelegate = SortPathDelegate.common, bool sortPathsByModifiedDate = false, PMFilter? filterOptions, Duration initializeDelayDuration = const Duration(milliseconds: 250)})
DefaultAssetPickerProvider.forTest({List<AssetEntity>? selectedAssets, RequestType requestType = RequestType.image, SortPathDelegate<AssetPathEntity>? sortPathDelegate = SortPathDelegate.common, bool sortPathsByModifiedDate = false, PMFilter? filterOptions, int maxAssets = defaultMaxAssetsCount, int pageSize = 80, ThumbnailSize pathThumbnailSize = defaultPathThumbnailSize})

Properties

currentAssets List<AssetEntity>
Assets under current path entity. 正在查看的资源路径下的所有资源
getter/setter pairinherited
currentAssetsListPage int
The current page for assets list. 当前加载的资源列表分页数
no setterinherited
currentPath PathWrapper<AssetPathEntity>?
The path which is currently using. 正在查看的资源路径
getter/setter pairinherited-getteroverride-setter
filterOptions PMFilter?
Filter options for the picker. 选择器的筛选条件
final
hasAssetsToDisplay bool
Whether there are any assets can be displayed. 是否有资源可供显示
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
hasMoreToLoad bool
Whether more assets are waiting for a load. 是否还有更多资源可以加载
no setterinherited
isAssetsEmpty bool
Whether there are assets on the devices. 设备上是否有资源文件
getter/setter pairinherited
isSelectedNotEmpty bool
选中资源是否为空
no setterinherited
maxAssets int
Maximum count for asset selection. 资源选择的最大数量
finalinherited
mounted bool
Whether the provider is mounted. Set to false if disposed.
no setterinherited
pageSize int
Assets should be loaded per page. 资源选择的最大数量
finalinherited
paths List<PathWrapper<AssetPathEntity>>
List for all path entity wrapped by PathWrapper. 所有资源路径的列表,以 PathWrapper 包装
getter/setter pairinherited
pathThumbnailSize ThumbnailSize
Thumbnail size for path selector. 路径选择器中缩略图的大小
finalinherited
previousSelectedAssets List<AssetEntity>
Selected assets before the picker starts picking. 选择器开始选择前已选中的资源
finalinherited
requestType RequestType
Request assets type. 请求的资源类型
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedAssets List<AssetEntity>
Selected assets. 已选中的资源
getter/setter pairinherited
selectedDescriptions String
Descriptions for selected assets currently. 当前已被选中的资源的描述
no setterinherited
selectedMaximumAssets bool
是否已经选择了最大数量的资源
no setterinherited
sortPathDelegate SortPathDelegate<AssetPathEntity>?
@{macro wechat_assets_picker.delegates.SortPathDelegate}
final
sortPathsByModifiedDate bool
Whether to allow sort delegates to sort paths with FilterOptionGroup.containsPathModified. 是否结合 FilterOptionGroup.containsPathModified 进行路径排序
final
totalAssetsCount int?
Total count for assets. 资源总数
getter/setter pairinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Clear all fields when dispose. 销毁时重置所有内容
inherited
getAssetCountFromPath(PathWrapper<AssetPathEntity> path) Future<void>
getAssetsFromCurrentPath() Future<void>
Get assets list from current path entity. 从当前已选路径获取资源列表
getAssetsFromPath([int? page, AssetPathEntity? path]) Future<void>
Get assets under the specific path entity. 获取指定路径下的资源
override
getPaths({bool onlyAll = false, bool keepPreviousCount = false}) Future<void>
Get paths. 获取所有的资源路径
override
getThumbnailFromPath(PathWrapper<AssetPathEntity> path) Future<Uint8List?>
Get the thumbnail from the first asset under the specific path entity. 获取指定路径下的第一个资源的缩略图数据
override
loadMoreAssets() Future<void>
Load more assets. 加载更多资源
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
selectAsset(AssetEntity item) → void
Select asset. 选中资源
inherited
setPathThumbnail(AssetPathEntity path, Uint8List? data) → void
Set thumbnail data for the specific path. 为指定的路径设置缩略图数据
inherited
switchPath([PathWrapper<AssetPathEntity>? path]) Future<void>
Switch between paths. 切换路径
override
toString() String
A string representation of this object.
inherited
unSelectAsset(AssetEntity item) → void
Un-select asset. 取消选中资源
inherited

Operators

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