入坑进行时。。

初始环境

初始环境配置 添加 临时变量(临时变量)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12

git clone -b master https://github.com/flutter/flutter.git
 ./flutter/bin/flutter --version

export PUB_HOSTED_URL=https://pub.flutter-io.cn

export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

export PATH=`pwd`/flutter/bin:$PATH

echo $PATH

按照上述步骤操作时: 执行flutter doctor 会提示 -bash: fultter: command not found 执行 source ~/.bashrc即可

将flutter添加到系统环境变量中

1
2
3
4
5
6
7
8
    touch ~/.bash_profile
    open ~/.bash_profile

    export PATH=`pwd`/flutter/bin:$PATH

    //保存后执行

    source ~/.bashrc (或重启终端)即可

vscode 配置

1
2
3
4
plugin 查找 flutter

ctrl + aommand + p  install  flutter doctor

fluter 版本更新 或 切换

1
2
3
4
flutter channel //查看分支

flutter upgrade //更新sdk

打包发布

1
flutter build apk --release

初始化基础代码配置

在flutter中使用第三方包

  1. 打开pubspec.yaml
1
2
3
2. 拉取声明的第三方库到本地工程

flutter packages get