pickFile static method

Future<XFile?> pickFile({
  1. Set<String> mimeTypes = const {},
  2. MutableLiveData<XFile?>? file,
  3. bool throwOnMimeTypeNotMatch = false,
})

Implementation

static Future<XFile?> pickFile(
        {Set<String> mimeTypes = const {}, MutableLiveData<XFile?>? file, bool throwOnMimeTypeNotMatch = false}) =>
    RawDropView.pickFiles(mimeTypes: mimeTypes, throwOnMimeTypeNotMatch: throwOnMimeTypeNotMatch)
        .toList()
        .then((value) {
      final result = value.iterator.let((iterator) => iterator.moveNext() ? iterator.current : null);
      if (result != null) file?.value = result;
      return result;
    });