android FilePickerCross.importFromStorage fails with type '_Exception' is not a subtype of type 'String'
Hello,i finished testing the app under linux, all well, now testing on android..... in the docu mobile seems preconfigured.... in the code i have
FilePickerCross? value = await FilePickerCross.importFromStorage(
type: FileTypeCross.any, // Available: `any`, `audio`, `image`, `video`, `custom`. Note: not available using FDE
fileExtension: '.exam' // Only if FileTypeCross.custom . May be any file extension like `dot`, `ppt,pptx,odp`
).onError((error, _) {
String _exceptionData = error.toString() ;
print('---------------------- FilePicker error : $error ${error.runtimeType}');
print('REASON: ${_exceptionData}');
if (_exceptionData == 'read_external_storage_denied') {
print('Permission was denied');
} else if (_exceptionData == 'selection_canceled') {
print('User canceled operation');
}
print('----------------------');
throw Exception("filecross error");
});;
no problems under linux, but on android:
---------------------- FilePicker error : type '_Exception' is not a subtype of type 'String' _TypeError
REASON: type '_Exception' is not a subtype of type 'String'
---------------------
BTW i had to change the String _exceptionData = error.reason();
to String _exceptionData = error.toString();
as there was no reason
method available
so what is going wrong here, and how to resolve it?