Get started with Flutter for Surface Duo

Important

This article describes functionality and guidance that is in public preview and may be substantially modified before it's generally available. Microsoft makes no warranties, express or implied, with respect to the information provided here.

To get started, follow the instructions to download and install the Surface Duo dual-screen emulator on a machine that you have also setup for Flutter development. You can follow the Flutter Getting Started Guide if you don't have flutter installed.

Flutter Foldable Support

Tip

Flutter Foldable Support is in public preview. Review the Modal routes PR and TwoPane widget PR on GitHub to provide feedback.

Flutter Foldable PR progress. MediaQuery is merged, while Dialogs and TwoPane are still pending review.

If you are interested only in MediaQuery support, you can consider switching to the Flutter master channel, using the flutter channel master command. If you also want to use TwoPane and dialogs, setting up requires using a custom version of Flutter.

  1. Clone the custom Flutter.
  2. Add the custom Flutter to your PATH.

These steps are explained in detail below.

Step 1. Clone the custom Flutter

Clone the repository of our Flutter Fork. The foldable_support_complete branch contains all the above PRs.

  1. git clone git@github.com:andreidiaconu/flutter.git
  2. cd flutter
  3. git branch foldable_support_complete

Step 2. Add the custom Flutter to your PATH

Update your PATH to include the bin folder from the newly created folder from Step 1, according to your operating system: Windows | macOS | Linux | Chrome OS.

That's it! You now have a custom Flutter Framework fork on your machine that contain all the changes related to foldable support and are able to build your app using the new MediaQuery support, TwoPane widget and Hinge aware popup routes.