pickFile static method

Future<UFileData?> pickFile({
  1. FileType fileType = FileType.any,
  2. List<String>? allowedExtensions,
  3. UCropOptions? crop,
  4. dynamic action(
    1. UFileData?
    )?,
})

Implementation

static Future<UFileData?> pickFile({
  FileType fileType = FileType.any,
  List<String>? allowedExtensions,
  UCropOptions? crop,
  Function(UFileData?)? action,
}) async {
  final List<UFileData> files = await showFilePicker(fileType: fileType, allowedExtensions: allowedExtensions, crop: crop);
  final UFileData? file = files.isEmpty ? null : files.first;
  action?.call(file);
  return file;
}