In order to use this plugin, add dependency in the pubspec.yaml:
file_selector: git: url: https://github.com/marchdev-tk/file_selectorAdd an import to dart file:
import 'package:file_selector/file_selector.dart';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:- any or
*/* - img or
image/*- png or
image/png - jpg or
image/jpeg - gif or
image/gif - bmp or
image/bmp
- png or
- pdf or
application/pdf
- any or
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.
Feel free to post a feature requests or report a bug here.