Flutter 桌面开发Windows应用要点

 

 ready 准备工作 使用master版本

git clone -b master https://github.com/flutter/flutter.git

or

flutter channel master

 

flutter upgrade

flutter doctor

 

run example运行范例

set ENABLE_FLUTTER_DESKTOP=true

flutter devices

cd flutter/../ ##和flutter同一目录安装 https://github.com/google/flutter-desktop-embedding

git clone https://github.com/google/flutter-desktop-embedding.git

cd example

flutter packages get

flutter run

 

 

new project 如果是新建项目要准备

copy ..\flutter-desktop-embedding\example\windows .

修改添加 lib/main.dart 

import 'dart:io' show Platform;


import 'package:flutter/foundation.dart' show debugDefaultTargetPlatformOverride;



void main() {

// See https://github.com/flutter/flutter/wiki/Desktop-shells#target-platform-override

debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;

runApp(new MyApp());

 }

 

see also

https://github.com/wintops/Atopas/blob/master/flutter_windows.md

你可能感兴趣的:(flutter,flutter,Windows,desktop)