AssetPickerProvider<Asset, Path> class abstract

Helps the assets picker to manage Paths and Assets.

The provider maintain all methods that control assets and paths. By extending it you can customize how you can get all assets or paths, how to fetch the next page of assets, and how to get the thumbnail data of a path.

Inheritance
Implementers

Constructors

AssetPickerProvider({int maxAssets = defaultMaxAssetsCount, int pageSize = defaultAssetsPerPage, ThumbnailSize pathThumbnailSize = defaultPathThumbnailSize, List<Asset>? selectedAssets})

Properties

currentAssets List<Asset>
Assets under current path entity. 正在查看的资源路径下的所有资源
getter/setter pair
currentAssetsListPage int
The current page for assets list. 当前加载的资源列表分页数
no setter
currentPath PathWrapper<Path>?
The path which is currently using. 正在查看的资源路径
getter/setter pair
hasAssetsToDisplay bool
Whether there are any assets can be displayed. 是否有资源可供显示
getter/setter pair
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 setter
isAssetsEmpty bool
Whether there are assets on the devices. 设备上是否有资源文件
getter/setter pair
isSelectedNotEmpty bool
选中资源是否为空
no setter
maxAssets int
Maximum count for asset selection. 资源选择的最大数量
final
mounted bool
Whether the provider is mounted. Set to false if disposed.
no setter
pageSize int
Assets should be loaded per page. 资源选择的最大数量
final
paths List<PathWrapper<Path>>
List for all path entity wrapped by PathWrapper. 所有资源路径的列表,以 PathWrapper 包装
getter/setter pair
pathThumbnailSize ThumbnailSize
Thumbnail size for path selector. 路径选择器中缩略图的大小
final
previousSelectedAssets List<Asset>
Selected assets before the picker starts picking. 选择器开始选择前已选中的资源
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedAssets List<Asset>
Selected assets. 已选中的资源
getter/setter pair
selectedDescriptions String
Descriptions for selected assets currently. 当前已被选中的资源的描述
no setter
selectedMaximumAssets bool
是否已经选择了最大数量的资源
no setter
totalAssetsCount int?
Total count for assets. 资源总数
getter/setter pair

Methods

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

Operators

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