ChromeOS install

System requirements

To install and run Flutter on a Chromebook, your machine must have Linux enabled from the Developers tab of Settings.

The amount of disk space required varies depending on which target platforms you enable. We recommend that you increase the disk size for the Linux environment from the default of 10GB to 32GB or larger, to accommodate Android Studio and other tooling.

Get the Flutter SDK

  1. Install the core development tools needed for Flutter:

    $ sudo apt install clang cmake ninja-build pkg-config libgtk-3-dev
    

    This downloads the compiler toolchain needed to compile apps for ChromeOS.

  2. Download Flutter from the Flutter repo on GitHub with the following command in your home directory:

    $ git clone https://github.com/flutter/flutter.git -b stable
    
  3. Add the flutter tool to your path:

    $ echo PATH="$PATH:`pwd`/flutter/bin" >> ~/.profile
    $ source ~/.profile
    

You are now ready to run Flutter commands!

Run flutter doctor

Run the following command to see if there are any dependencies you need to install to complete the setup (for verbose output, add the -v flag):

$ flutter doctor

This command checks your environment and displays a report to the terminal window. The Dart SDK is bundled with Flutter; it is not necessary to install Dart separately. Check the output carefully for other software you might need to install or further tasks to perform (shown in bold text).

For example:

[-] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
    Install Android Studio from:
    https://developer.android.com/studio/index.html

The following sections describe how to perform these tasks and finish the setup process.

Once you have installed any missing dependencies, run the flutter doctor command again to verify that you’ve set everything up correctly.

Configuring web app support

On ChromeOS, you do development work in a Linux container. However, the Chrome browser itself is part of the parent ChromeOS operating system, and Flutter doesn’t have a means to call it with the required parameters.

Track this issue at Issue 121462: Improve the web debugging experience on Chromebooks.

Instead, the best approach is to manually install a second copy of Chrome in the Linux container. You can do that with the following steps:

$ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
$ sudo apt install ./google-chrome-stable_current_amd64.deb

Configuring Android app support

Install Android Studio

  1. Download and install Android Studio.
  2. Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, platform tools and build tooling that are required by Flutter when developing for Android.
  3. From the welcome dialog, choose More Actions -> SDK Manager. From the SDK Tools tab, select Android SDK Command-line Tools (latest) to install additional necessary tooling.
  4. Accept Android licenses.
$ flutter doctor --android-licenses

Deploy to your Chromebook

To deploy apps directly to your Chromebook, you need to do the following:

  1. Enable ADB in Settings. Note that this requires you to reboot your device once.
  2. In the Terminal, run flutter devices. If prompted, authorize access to the Android container. Verify that flutter devices lists your ChromeOS device as a recognized device.

Set up your Android device

To prepare to run and test your Flutter app on an attached device, you need an Android device running Android 5.0 (API level 21) or higher.

  1. Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
  2. Using a USB cable, plug your phone into your computer. On your Chromebook, you might see a notification for “USB device detected”. Click on “Connect to Linux”. If prompted on your Android device, authorize your computer to access your device.
  3. In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device. By default, Flutter uses the version of the Android SDK where your adb tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_SDK_ROOT environment variable to that installation directory.

Next step

Set up your preferred editor.