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';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*/*imgorimage/*pngorimage/pngjpgorimage/jpeggiforimage/gifbmporimage/bmp
pdforapplication/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 filepathto the file, for Web it is emptybytesarray of bytes
Feel free to post a feature requests or report a bug here.


