搭建Flutter开发环境需要注意的几个小Tips
下载SDK
放到指定目录,配置环境变量
具体步骤结合自己电脑参考flutter中文网
安装
Android Stdio + SDK + tool SDK + 创建模拟器 + 插件(flutter和dart)
下载Android Stdio
网上很多资源,我推荐这个网站,资源比较集中
~/.zshrc
或者~/.bash_profile
配置环境变量
# android sdk
export ANDROID_HOME="/Users/wangguibin/Library/Android/sdk"
export PATH=${PATH}:${ANDROID_HOME}/tools
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
由于大陆有墙,可在/etc/hosts
文件中加入以下镜像或者代理,下载Android SDK
顺畅无比
(PS. 当前时间2020年2月19日,亲测可用!)
# Android Start
119.28.87.227 android.com
119.28.87.227 www.android.com
119.28.87.227 a.android.com
119.28.87.227 connectivitycheck.android.com
119.28.87.227 d.android.com
119.28.87.227 dev.android.com
119.28.87.227 developer.android.com
119.28.87.227 market.android.com
119.28.87.227 r.android.com
119.28.87.227 source.android.com
119.28.87.227 android-china.l.google.com
119.28.87.227 android.clients.google.com
119.28.87.227 android-market.l.google.com
119.28.87.227 android.l.google.com
119.28.87.227 android.googleblog.com
119.28.87.227 androidstudio.googleblog.com
119.28.87.227 android-developers.googleblog.com
119.28.87.227 android-developers.blogspot.com
119.28.87.227 android-developers.blogspot.hk
119.28.87.227 officialandroid.blogspot.com
119.28.87.227 android.googlecode.com
119.28.87.227 android.googlesource.com
119.28.87.227 android-review.googlesource.com
119.28.87.227 androidmarket.googleusercontent.com
119.28.87.227 android.googleapis.com
119.28.87.227 jmoore-dot-android-experiments.appspot.com
119.28.87.227 b.android.com
64.233.188.121 m.android.com
64.233.188.121 tools.android.com
64.233.191.121 jmoore-dot-android-experiments.appspot.com
64.233.191.121 maven.google.com
# Android End
Xcode + cocoapods
Xcode
在App Store
或者开发者中心下载即可
Cocoapods
安装
sudo gem install cocoapods
flutter doctor 检测环境是否可行
flutter doctor --android-licenses 安卓验证SDK
VSCode + Flutter开发必备辅助插件
Flutter
语法及调试插件Dart
语法插件Awesome Flutter Snippets
代码块Flutter Widget Snippets
组件代码块Bracket Pair Colorizer
彩虹🌈括号Flutter Stylizer
API使用提示Material Icon Theme
图标主题TODO-HIGHLIGHT
代码标记注释TODO-tree
方便查找标记的代码Better Comments
划重点的注释dart-import
自动导入目录(建议自己写相对目录好些)Image preview
图片图标预览
VSCode自定义的一些配置
{
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
180
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
},
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"editor.snippetSuggestions": "top",
"editor.fontSize": 18,
"workbench.iconTheme": "material-icon-theme",
"dart.debugExternalLibraries": false,
"dart.debugSdkLibraries": false,
"dart.enableCompletionCommitCharacters": true,
"dart.flutterHotRestartOnSave": true,
"dart.lineLength": 80,
"dart.previewFlutterUiGuides": true,
"dart.triggerSignatureHelpAutomatically": true,
"terminal.integrated.shell.osx": "/bin/zsh",
"editor.formatOnSave": true,
"editor.wordWrap": "on",
"window.newWindowDimensions": "inherit",
"window.openFilesInNewWindow": "default",
"todo-tree.tree.showScanModeButton": false,
"C_Cpp.updateChannel": "Insiders",
"workbench.editor.enablePreview": false,
}
未经作者授权,禁止转载
本文来自博客园,作者:CoderWGB,转载请注明原文链接:https://www.cnblogs.com/wgb1234/p/12426113.html
THE END