showPickerAssets static method

Future<List<AssetEntity>?> showPickerAssets(
  1. BuildContext context, {
  2. bool useRootNavigator = true,
  3. bool mounted = true,
  4. FlAssetsPickerCheckPermission? checkPermission,
  5. Key? key,
  6. AssetPickerConfig pickerConfig = const AssetPickerConfig(),
  7. AssetPickerPageRouteBuilder<List<AssetEntity>>? pageRouteBuilder,
})

选择图片

Implementation

static Future<List<AssetEntity>?> showPickerAssets(BuildContext context,
    {bool useRootNavigator = true,
    bool mounted = true,
    FlAssetsPickerCheckPermission? checkPermission,
    Key? key,
    AssetPickerConfig pickerConfig = const AssetPickerConfig(),
    AssetPickerPageRouteBuilder<List<AssetEntity>>? pageRouteBuilder}) async {
  final permissionState =
      await checkPermission?.call(PickerFromType.assets) ?? true;
  if (!permissionState || !mounted) return null;
  return await AssetPicker.pickAssets(context,
      key: key,
      pickerConfig: pickerConfig,
      useRootNavigator: useRootNavigator,
      pageRouteBuilder: pageRouteBuilder);
}