Get started
- get SDK 👉Flutter SDK releases
- update system path
- update user path
flutter doctor
- 👉Android Studio
First Go
flutter create projectname
code ./
open by vscodeflutter doctor
re-examinedflutter emulator
check emulatorflutter emulators --launch Pixel_3a_API_30_x86
run the emulatorflutter run
orflutter run -d <emulatorId>
Get lib
- 👉pub.dev
在项目目录下 pubspec.yaml 里加入依赖和版本号
1
2
3
4
5
6
7
8
9
10
11
12dependencies:
flutter:
sdk: flutter
intl: ^0.17.0
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
dev_dependencies:
flutter_test:
sdk: flutter保存即可,或者到 console 执行
flutter packages get
In process
Could not receive a message from the daemon.
- 关闭共享的网络即可 👉Could not receive a message from the daemon
Other
异常关闭 emulator 导致再次启动黑屏
- 原因是因为 emulator 启动采用的是热启动,下次启动会采用上次关闭保存的状态
- 解决方法:用 Android Studio 打开 emulator 设置,用 Cold boot now 即可,下次启动用回原本的启动方式即可
- bat 启动脚本
1
2
3call C:\Users\[userName]\AppData\Local\Android\Sdk\emulator\emulator.exe -netspeed full -avd Pixel_2_API_30
rem avd 默认目录 C:\Users\[userName]\.android\avd
包依赖冲突
- 把冲突的包版本改为 any
- 👉 Resolving package version conflicts in Dart