import 'package:app_flowy/util/file_picker/file_picker_service.dart'; import 'package:file_picker/file_picker.dart' as fp; class FilePicker implements FilePickerService { @override Future getDirectoryPath({String? title}) { return fp.FilePicker.platform.getDirectoryPath(); } @override Future pickFiles( {String? dialogTitle, String? initialDirectory, fp.FileType type = fp.FileType.any, List? allowedExtensions, Function(fp.FilePickerStatus p1)? onFileLoading, bool allowCompression = true, bool allowMultiple = false, bool withData = false, bool withReadStream = false, bool lockParentWindow = false}) async { final result = await fp.FilePicker.platform.pickFiles( dialogTitle: dialogTitle, initialDirectory: initialDirectory, type: type, allowedExtensions: allowedExtensions, onFileLoading: onFileLoading, allowCompression: allowCompression, allowMultiple: allowMultiple, withData: withData, withReadStream: withReadStream, lockParentWindow: lockParentWindow, ); return FilePickerResult(result?.files ?? []); } }