创建后的项目想要运行web端,使用如下命令
开启web
flutter config --enable-web true
开启 enable-macos-desktop
flutter config --enable-macos-desktop
flutter config --enable-macos-desktop true
查看是否都已经开启
flutter config

把两个值都变成true 后,目录结构应该多出一个web的目录
由于构建的时候并没有打开这两个配置,则需要重新使用命令,当前目录重新构建
flutter create .
这是目录多出一个macos 目录

查看链接设备
flutter devices
运行浏览器命令
flutter run -d Chrome
网友评论