如何为 Flutter 启用 Windows UWP?

Gue*_*OCs 5 windows uwp flutter

我关注了https://medium.com/flutter-community/publishing-flutter-windows-apps-to-microsoft-partner-center-with-codemagic-b1962575510c但频道开发和测试版没有启用 uwp 的选项:

\n
Flutter 3.1.0-9.0.pre \xe2\x80\xa2 channel beta \xe2\x80\xa2 https://github.com/flutter/flutter.git\nFramework \xe2\x80\xa2 revision f28e570c8c (5 weeks ago) \xe2\x80\xa2 2022-06-14 13:39:33 -0500\nEngine \xe2\x80\xa2 revision 74ee6b5afd\nTools \xe2\x80\xa2 Dart 2.18.0 (build 2.18.0-165.1.beta) \xe2\x80\xa2 DevTools 2.14.0\nPS C:\\Users\\lz> flutter config --enable-windows-uwp-desktop\nCould not find an option named "enable-windows-uwp-desktop".\n\n\n Run \'flutter -h\' (or \'flutter <command> -h\') for available flutter commands and options.\n
Run Code Online (Sandbox Code Playgroud)\n

通道dev(已弃用)也会给出相同的错误。

\n

在稳定版上它有以下选项:

\n
[\xe2\x9c\x93] Flutter (Channel stable, 3.0.5, on Microsoft Windows [Version 10.0.19044.1288], locale en-GB)\n\nPS C:\\Users\\me> flutter config --enable-windows-uwp-desktop\n\nSetting "enable-windows-uwp-desktop" value to "true".\n\nYou may need to restart any open editors for them to read new settings.\n
Run Code Online (Sandbox Code Playgroud)\n

但是,当我这样做时flutter create myapp,它只有一个 windows 文件夹(win32),而不是像它应该的那样的 winuwp 。

\n

我使用的是 Windows 10,全新安装了 Flutter 和 Visual Studio SDK,并安装了 Windows 10 SDK C++。

\n

lep*_*sch 4

由于 UWP 正在被 Microsoft 淘汰,Flutter 团队将重点放在 Win32 方面,以限制范围。此处完全删除了对 UWP 的支持。

在这里查看主要问题:https://github.com/flutter/flutter/issues/14967#issuecomment-1085490495