DefaultAssetPickerProvider constructor

DefaultAssetPickerProvider({
  1. List<AssetEntity>? selectedAssets,
  2. RequestType requestType = RequestType.image,
  3. SortPathDelegate<AssetPathEntity>? sortPathDelegate = SortPathDelegate.common,
  4. FilterOptionGroup? filterOptions,
  5. int maxAssets = 9,
  6. int pageSize = 80,
  7. int pathThumbSize = 80,
  8. Duration routeDuration = const Duration(milliseconds: 300),
})

Call getAssetList with route duration when constructing. 构造时根据路由时长延时获取资源

Implementation

DefaultAssetPickerProvider({
  List<AssetEntity>? selectedAssets,
  this.requestType = RequestType.image,
  this.sortPathDelegate = SortPathDelegate.common,
  this.filterOptions,
  int maxAssets = 9,
  int pageSize = 80,
  int pathThumbSize = 80,
  Duration routeDuration = const Duration(milliseconds: 300),
}) : super(
        maxAssets: maxAssets,
        pageSize: pageSize,
        pathThumbSize: pathThumbSize,
        selectedAssets: selectedAssets,
      ) {
  Constants.sortPathDelegate = sortPathDelegate ?? SortPathDelegate.common;
  Future<void>.delayed(routeDuration).then(
    (dynamic _) async {
      await getAssetPathList();
      await getAssetList();
    },
  );
}