Flutter 安装

终端打开 open ~,显示隐藏文件,有个 .bash_profile 是配置环境变量的,

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
//flutter环境变量
export PATH=/Users/qrh/Documents/flutter/bin:$PATH
//Android 环境变量
export ANDROID_HOME="/Users/qrh/Library/Android/sdk”
//android tools 路径
export PATH=${PATH}:${ANDROID_HOME}/tools
//android platform-tools 路径
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
//终端命令运行安卓模拟器
export PATH=${PATH}:${ANDROID_HOME}/emulator

配置好了,就可根据 emulator -avd Nexus_5X_API_28 命令启动安卓模拟器了

https://developer.android.google.cn/

然后是android studio 的配置,输入 flutter doctor 检查flutter 是否配置正确,下图的1,2,4必须打钩

image.png

Flutter requires Android SDK 28 and the Android BuildTools 28.0.3

Flutter 要求 android sdk 是 28 和 android buildtool 是28.0.3

打开 android studio preference 设置,

选项Appearance & Behavior 中的System Setting 的Android SDK 中可以找到

image.png

创建项目,项目名不能大写

flutter create flutterday01

flutter run 运行iOS

flutter run -d ‘iPhone XS MAX’ 好像只对iOS 有用

Android 运行

Dart 语法
http://dart.goodev.org
flutter UI 布局
https://github.com/yang7229693/flutter-study
flutter 教程
http://www.devio.org/tags/#Flutter
资料
https://github.com/flutter/flutter/tree/master/examples
https://github.com/flutter/samples
https://github.com/iampawan/FlutterExampleApps
https://github.com/nisrulz/flutter-examples

你可能感兴趣的:(Flutter 安装)