How to Pick files and Images for upload with flutter web


I would like to know how to pick an Image from the users computer into my flutter web app for upload


Using dart:html package directly in Flutter is not recommended.

Instead, use this package:

Example of how to use in Flutter Web:

class FileUploadButton extends StatelessWidget {
  Widget build(BuildContext context) {
    return RaisedButton(
      child: Text('UPLOAD FILE'),
      onPressed: () async {
        var picked = await FilePicker.platform.pickFiles();

        if (picked != null) {

Note that FilePickerResult.path is not supported in Flutter Web.

Answered By – jnt

Answer Checked By – Timothy Miller (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *