Fond the solution. Just as information for anyone else interested,
dart:html has FileUploadInputElement, which can be called from onTap
and works in flutter web:
onTap: () async {
InputElement uploadInput = FileUploadInputElement();
uploadInput.click();
uploadInput.onChange.listen((e) {
final files = uploadInput.files;
if (files.length == 1) {
final file = files[0];
final reader = new FileReader();
reader.onLoadEnd.listen((e) {
print("loaded: ${
file.name}");
print("type: ${reader.result.runtimeType}");
});
reader.onError.listen((e) {
print(e);
});
reader.readAsArrayBuffer(file);
}
});
},
Credits go toi:
https://stackoverflow.com/questions/56457214/is-there-any-plugin-or-way-to-upload-file-to-server-using-flutter-web
Cheers,
Andrea
On Thu, Oct 3, 2019 at 3:33 PM andrea antonello