Try Flutter

Get started

First Go

  • flutter create projectname
  • code ./ open by vscode
  • flutter doctor re-examined
  • flutter emulator check emulator
  • flutter emulators --launch Pixel_3a_API_30_x86 run the emulator
  • flutter run or flutter run -d <emulatorId>

Get lib

  • 👉pub.dev
  • 在项目目录下 pubspec.yaml 里加入依赖和版本号

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    dependencies:
    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.

Other

异常关闭 emulator 导致再次启动黑屏

  • 原因是因为 emulator 启动采用的是热启动,下次启动会采用上次关闭保存的状态
  • 解决方法:用 Android Studio 打开 emulator 设置,用 Cold boot now 即可,下次启动用回原本的启动方式即可
  • bat 启动脚本
    1
    2
    3
    call C:\Users\[userName]\AppData\Local\Android\Sdk\emulator\emulator.exe  -netspeed full -avd Pixel_2_API_30

    rem avd 默认目录 C:\Users\[userName]\.android\avd

包依赖冲突

< - 僕らは知らない - >