In order to use this plugin, add dependency in the pubspec.yaml:
file_selector: git: url: https://github.com/marchdev-tk/file_selector
Add an import to dart file:
import 'package:file_selector/file_selector.dart';
Web sample:
Desktop sample:
Mobile sample:
final File file = await FileSelector().pickFile( type: FileType.img, confirmButtonText: 'Select', );
where:
- 
confirmButtonText(works only onDesktop) if set, changes default confirmation text on file picker popup;
- 
typerepresents the group of required types of specific type, could be one of the following:- anyor- */*
- imgor- image/*- pngor- image/png
- jpgor- image/jpeg
- gifor- image/gif
- bmpor- image/bmp
 
- pdfor- application/pdf
 
final List<File> files = await FileSelector().pickFiles( types: [FileType.png, FileType.bmp], confirmButtonText: 'Select', );
The only difference of pickFiles method from pickFile is that multiple files could be selected same as multiple types.
- nameof the file
- pathto the file, for Web it is empty
- bytesarray of bytes
Feel free to post a feature requests or report a bug here.