Set up web development for Flutter from Android on Linux start

To add web as a Flutter app target for Linux with Android, follow this procedure.

Configure Chrome as the web DevTools tools

#
  1. Allocate a minimum of 1 GB of storage for Google Chrome. Consider allocating 2 GB of storage for an optimal configuration.

  2. Download and install the Linux version of Google Chrome to debug JavaScript code for web apps.

How to install Chrome from the command line
$ wget https://dl-ssl.google.com/linux/linux_signing_key.pub -O /tmp/google.pub
$ gpg --no-default-keyring \
        --keyring /etc/apt/keyrings/google-chrome.gpg \
        --import /tmp/google.pub
$ echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main' | sudo tee /etc/apt/sources.list.d/google-chrome.list
$ sudo apt-get update -y; sudo apt-get install -y google-chrome-stable

Check your development setup

#

help Help

Run Flutter doctor

#

The flutter doctor command validates that all components of a complete Flutter development environment for Linux.

  1. Open a shell.

  2. To verify your installation of all the components, run the following command.

    $ flutter doctor

As you chose to develop for Web, you do not need all components. If you followed this guide, the result of your command should resemble:

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.6, on Ubuntu 20.04 (LTS), locale en)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.5)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] Linux toolchain - develop for Linux desktop
[✓] VS Code (version 1.89)
[✓] Connected device (1 available)
[✓] Network resources


∙ No issues found!

Troubleshoot Flutter doctor issues

#

When the flutter doctor command returns an error, it could be for Flutter, VS Code, one of the Linux libraries, the connected device, or network resources.

If the flutter doctor command returns an error for any of these components, run it again with the verbose flag.

$ flutter doctor -v

Check the output for other software you might need to install or further tasks to perform.

If you change the configuration of your Flutter SDK or its related components, run flutter doctor again to verify the installation.

Start developing Web on Linux apps with Flutter

#

Congratulations! Now that you have installed all prerequisites and the Flutter SDK, you should be able to start developing Flutter apps for Web on Linux.