AssetPickerProvider<Asset, Path> class abstract

ChangeNotifier for assets picker.

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, how to get the thumb data of a path.

Inheritance
Implementers

Constructors

AssetPickerProvider({int maxAssets = 9, int pageSize = 320, int pathThumbSize = 80, List<Asset>? selectedAssets})

Properties

currentAssets List<Asset>
getter/setter pair
currentAssetsListPage int
The current page for assets list. 当前加载的资源列表分页数
no setter
currentPathEntity ↔ Path?
getter/setter pair
hasAlbumsToDisplay bool
getter/setter pair
hasAssetsToDisplay bool
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
getter/setter pair
isSelectedNotEmpty bool
选中资源是否为空
no setter
isSwitchingPath bool
getter/setter pair
maxAssets int
Maximum count for asset selection. 资源选择的最大数量
getter/setter pair
maximumAssets int
no getter
mounted bool
no setter
pageSize int
Assets should be loaded per page. 资源选择的最大数量
final
pathEntityList Map<String, Tuple2<Path, Uint8List?>?>
no setter
pathThumbSize int
Thumb size for path selector. 路径选择器中缩略图的大小
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedAssets List<Asset>
getter/setter pair
selectedDescriptions String
Descriptions for selected assets currently. 当前已被选中的资源的描述
no setter
selectedMaximumAssets bool
是否已经选择了最大数量的资源
no setter
totalAssetsCount int
getter/setter pair
validPathThumbCount int
How many path has a valid thumb data. 当前有多少目录已经正常载入了缩略图
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearAll() → void
dispose() → void
Clear all fields when dispose. 销毁时重置所有内容
override
getAssetPathList() Future<void>
Get assets path entities. 获取所有的资源路径
getAssetsFromEntity(int page, Path pathEntity) Future<void>
Get assets under the specific path entity. 获取指定路径下的资源
getFirstThumbFromPathEntity(Path pathEntity) Future<Uint8List?>
Get thumb data 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.
inherited
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. 选中资源
switchPath([Path? pathEntity]) Future<void>
Switch path entity. 切换路径
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