flutter安装及项目踩坑
1.安装brew (Failed to connect to raw.githubusercontent.com port 443: Connection refused)
/bin/zsh -c “$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”
管网历史版本
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#macos
将sdk拖到文档目录
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=/Users/Yiwi/Documents/flutter/bin:$PATH
flutter doctor
flutter vscode插件推荐
-
Flutter 与 Dart
-
模版神器
Awesome Flutter Snippets
3.对Dart语法有帮助的神器
Bracket Pair Colorizer
- 对项目开发有帮助的插件
Material Icon Theme
配置 Flutter iOS环境
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup
cd到目录下面
flutter pub get
cd ios目录下面
pod install
常见错误处理
1.warning: The iOS deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 4.3,
but the range of supported deployment target versions is 8.0 to 13.4.99.
config.build_settings[‘IPHONEOS_DEPLOYMENT_TARGET’] = ‘9.0’
2.flutter1.7.0版本对用的dio 库会出问题将dio 版本升到3.0.0以上(3.0.9)
dio.options.contentType = ContentType.parse(‘application/x-www-form-urlencoded’);
报错在后面加上.toString()
3.flutter1.5.0版本的fluro 里面会有个路由类名冲突
本文地址:https://blog.csdn.net/yxw125125/article/details/109641132