Flutter安装与环境配置
git clone https://github.com/flutter/flutter.git
export PATH=`pwd`/flutter/bin:$PATH
cd flutter
./bin/flutter config --no-analytics
禁用通过 Google Analytics 发送数据(以免国内网络连接失败问题)-
flutter doctor
在执行命令过程中可能会失败,可能是网络原因,没关系,多试几次。
PauldeMBP% flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel dev, v0.1.5, on Mac OS X 10.13.2 17C88, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK 27.0.2) [✓] iOS toolchain - develop for iOS devices (Xcode 9.0) [✓] Android Studio (version 3.0) [✓] Connected devices (1 available) • No issues found!
编辑器配置
-
使用AndroidStudio编辑器开发Flutter,需要安装Flutter插件。
AndroidStudio->Preferences->Plugins->Browse repositories->搜索flutter->install->restart.
-
AndroidStudio配置Flutter SDK
AndroidStudio->Preferences->搜索Flutter->指定Flutter SDK path为刚刚下载的flutter目录。
运行
- 打开AndroidStudio,创建Flutter工程,创建Android 或 IOS模拟器后,运行就可以看到了。如下图
也可以访问google_flutter_cn开始Flutter之旅。