@@ -15,8 +15,6 @@ import '../constants/constants.dart';
1515/// By extending it you can customize how you can get all assets or paths,
1616/// how to fetch the next page of assets, how to get the thumb data of a path.
1717abstract class AssetPickerProvider <A , P > extends ChangeNotifier {
18- /// Call [getAssetList] with route duration when constructing.
19- /// 构造时根据路由时长延时获取资源
2018 AssetPickerProvider ({
2119 this .maxAssets = 9 ,
2220 this .pageSize = 320 ,
@@ -129,6 +127,15 @@ abstract class AssetPickerProvider<A, P> extends ChangeNotifier {
129127
130128 Map <P , Uint8List ?> get pathEntityList => _pathEntityList;
131129
130+ /// How many path has a valid thumb data.
131+ /// 当前有多少目录已经正常载入了缩略图
132+ ///
133+ /// This getter provides a "Should Rebuild" condition judgement to [Selector]
134+ /// with the path entities widget.
135+ /// 它为目录部件展示部分的 [Selector] 提供了是否重建的条件。
136+ int get validPathThumbCount =>
137+ _pathEntityList.values.where ((Uint8List ? d) => d != null ).length;
138+
132139 /// The path which is currently using.
133140 /// 正在查看的资源路径
134141 P ? _currentPathEntity;
@@ -216,6 +223,8 @@ abstract class AssetPickerProvider<A, P> extends ChangeNotifier {
216223
217224class DefaultAssetPickerProvider
218225 extends AssetPickerProvider <AssetEntity , AssetPathEntity > {
226+ /// Call [getAssetList] with route duration when constructing.
227+ /// 构造时根据路由时长延时获取资源
219228 DefaultAssetPickerProvider ({
220229 List <AssetEntity >? selectedAssets,
221230 this .requestType = RequestType .image,
0 commit comments