pick method

  1. @override
Future<List<IosDocumentPickerPath>?> pick(
  1. IosDocumentPickerType type, {
  2. bool? multiple,
  3. List<String>? allowedUtiTypes,
  4. String? initialDirectoryUrl,
})
override

Implementation

@override
Future<List<IosDocumentPickerPath>?> pick(
  IosDocumentPickerType type, {
  bool? multiple,
  List<String>? allowedUtiTypes,
  String? initialDirectoryUrl,
}) async {
  var maps = await methodChannel
      .invokeListMethod<Map<dynamic, dynamic>>('pick', {
        'type': type.index,
        'multiple': multiple,
        'allowedUtiTypes': allowedUtiTypes,
        'initialDirectoryUrl': initialDirectoryUrl,
      });
  if (maps == null) {
    return null;
  }
  return maps
      .map(
        (e) => IosDocumentPickerPath.fromMap(
          e,
          onRelease: (accessToken) => methodChannel.invokeMethod<void>(
            'release',
            {'accessToken': accessToken},
          ),
        ),
      )
      .toList();
}