pickAssets method
Future<List<ExtendedAssetEntity> ?>
pickAssets(
- BuildContext context, {
- AssetPickerConfig? pickerConfig,
- AssetPickerPageRouteBuilder<
List< ? pageRouteBuilder,AssetEntity> >
选择图片
Implementation
Future<List<ExtendedAssetEntity>?> pickAssets(BuildContext context,
{bool useRootNavigator = true,
AssetPickerConfig? pickerConfig,
AssetPickerPageRouteBuilder<List<AssetEntity>>? pageRouteBuilder}) async {
final List<AssetEntity>? assets = await FlAssetsPicker.showPickerAssets(
context,
checkPermission: _assetsPicker.checkPermission,
pickerConfig: pickerConfig ?? assetConfig,
useRootNavigator: useRootNavigator,
pageRouteBuilder: pageRouteBuilder);
if (assets != null && assets.isNotEmpty) {
List<ExtendedAssetEntity> list = [];
for (var element in assets) {
if (!allAssetEntity.contains(element)) {
list.add(await element.toExtensionAssetEntity(
renovate: _assetsPicker.renovate));
}
}
return list;
}
return null;
}