File picker compatible with web
https://pub.dev/packages/file_picker
import 'package:file_picker/file_picker.dart';
class FileUploadButton extends StatelessWidget { @override Widget build(BuildContext context) { return RaisedButton( child: Text('UPLOAD FILE'), onPressed: () async { var picked = await FilePicker.platform.pickFiles(); if (picked != null) { print(picked.files.first.name); } }, ); } }
Comments