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