2

Thought I'd experiment with Flutter Desktop Windows. I used the following commands inside the VSCode terminal:

  1. flutter channel master
  2. flutter upgrade
  3. flutter config --enable-windows-desktop
  4. flutter devices

Which gives:

Windows • Windows • windows-x64 • Microsoft Windows [Version 10.0.17134.648]

I installed VS Studio Community 2019. Flutter Doctor gives:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, v1.14.4-pre.28, on Microsoft Windows [Version 10.0.17134.648], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.4.3)
[√] Android Studio (version 3.5)
[√] VS Code (version 1.41.1)
[√] Connected device (1 available)

Within VSCode, I ran Flutter: New Project. From the VSCode terminal inside my Hello World root folder, I ran flutter packages get followed by flutter run which gives No supported devices found? I know things are moving fast. Did I get a step wrong? (App runs fine inside an Android emulator)

buttonsrtoys
  • 2,359
  • 3
  • 32
  • 52
  • Did you try `flutter run -d windows`. Windows desktop support is in early technical preview at the moment, the most developed desktop support is for Mac https://github.com/flutter/flutter/wiki/Desktop-shells – Taha Rushain Jan 23 '20 at 18:06

1 Answers1

2

As stated on desktop shells Wiki:

Currently, macOS is the only desktop platform supported by flutter create.

As a starting point for Windows, you have to use flutter-desktop-embedding project.

Spatz
  • 18,640
  • 7
  • 62
  • 66
  • 1
    Yeah. I got it working with the embedding project before seeing your post. I found its Readme confusing as it says "This project was originally created to develop Windows, macOS, and Linux embeddings of Flutter. That work has since become part of Flutter." To me, implied it wasn't needed anymore, but it is. Specifically, you have to copy its examples/windows folder into your project and add "debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;" to main() before calling runApp. – buttonsrtoys Jan 23 '20 at 19:18
  • 2
    That README text was written when the desktop effort was at a very different stage, and I agree it's confusing at this point. I've updated it to better reflect how the project is currently used. – smorgan Jan 23 '20 at 23:54