進入AS后,device顯示loading,點擊運行提示無法找到設(shè)備
1 開啟模擬器
2 運行flutter devices 能夠找到設(shè)備
3 重啟as
無法使用flutter
AS要3.6 才能使用Flutter
執(zhí)行flutter 命令提示 (This is taking an unexpectedly long time.)
因為墻的原因,建議按照guide填寫國內(nèi)的源。
mac Terminal:
cd ~
open .bash_profile
添加下面兩行環(huán)境變量
#國內(nèi)用戶需要設(shè)置
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
package:http/http.dart 找不到
dependencies:
http: ^0.11.0 // --加入這行
flutter:
sdk: flutter
https://blog.csdn.net/Dreamfine/article/details/83859915
Dio網(wǎng)絡(luò)請求返回異常氓轰,但Flutter HttpClient正常訪問
DioError [DioErrorType.DEFAULT]: Error on line 1, column 17: Invalid media type: expected no more input.
原因,本地服務(wù)器浸卦,application/json,charset=utf-8 逗號應(yīng)該改為分號
return HttpResponse(json.dumps(result, ensure_ascii=False), content_type="application/json;charset=utf-8")
Failed assertion: line xxx pos xxx: 'data != null'
錯誤示范
var text = null;
new Text(text);
傳入的Text為空就會導(dǎo)致這個錯誤署鸡,解決辦法就是不傳空值
Failed assertion: line xxx pos xxx: 'data != null'