@@ -15,8 +15,6 @@ import '../constants/constants.dart';
15
15
/// By extending it you can customize how you can get all assets or paths,
16
16
/// how to fetch the next page of assets, how to get the thumb data of a path.
17
17
abstract class AssetPickerProvider <A , P > extends ChangeNotifier {
18
- /// Call [getAssetList] with route duration when constructing.
19
- /// 构造时根据路由时长延时获取资源
20
18
AssetPickerProvider ({
21
19
this .maxAssets = 9 ,
22
20
this .pageSize = 320 ,
@@ -129,6 +127,15 @@ abstract class AssetPickerProvider<A, P> extends ChangeNotifier {
129
127
130
128
Map <P , Uint8List ?> get pathEntityList => _pathEntityList;
131
129
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
+
132
139
/// The path which is currently using.
133
140
/// 正在查看的资源路径
134
141
P ? _currentPathEntity;
@@ -216,6 +223,8 @@ abstract class AssetPickerProvider<A, P> extends ChangeNotifier {
216
223
217
224
class DefaultAssetPickerProvider
218
225
extends AssetPickerProvider <AssetEntity , AssetPathEntity > {
226
+ /// Call [getAssetList] with route duration when constructing.
227
+ /// 构造时根据路由时长延时获取资源
219
228
DefaultAssetPickerProvider ({
220
229
List <AssetEntity >? selectedAssets,
221
230
this .requestType = RequestType .image,
0 commit comments