pick method

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

Implementation

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