|
|
|
|
@ -45,7 +45,7 @@ class ImageOptions {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onFilesTap: () async {
|
|
|
|
|
Permission.storage.isGranted.then((isGranted) {
|
|
|
|
|
Permission.storage.isGranted.then((isGranted) async {
|
|
|
|
|
if (!isGranted) {
|
|
|
|
|
Permission.manageExternalStorage.request().then((granted) async {
|
|
|
|
|
if (granted == PermissionStatus.granted) {
|
|
|
|
|
@ -79,6 +79,25 @@ class ImageOptions {
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
FilePickerResult? result = await FilePicker.platform.pickFiles(
|
|
|
|
|
type: FileType.custom,
|
|
|
|
|
allowedExtensions: [
|
|
|
|
|
'jpg',
|
|
|
|
|
'jpeg ',
|
|
|
|
|
'pdf',
|
|
|
|
|
'txt',
|
|
|
|
|
'docx',
|
|
|
|
|
'doc',
|
|
|
|
|
'pptx',
|
|
|
|
|
'xlsx',
|
|
|
|
|
'png',
|
|
|
|
|
'rar',
|
|
|
|
|
'zip',
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
List<File> files = result!.paths.map((path) => File(path!)).toList();
|
|
|
|
|
image(result.files.first.path.toString(), files.first);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|