【发布时间】:2021-06-25 03:39:04
【问题描述】:
我刚刚更新到 Flutter 2。我更新了所有依赖项,包括 http。现在我遇到了以下问题:
Future<UserLogin> fetchStaff(String pUserName, String pPassword) async {
final response = await http
.post(Uri.encodeFull('$kBaseUrl/LoginService/CheckLogin'),
headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
body: '{ "pUser": "$pUserName", "pPassword": "$pPassword"}')
.timeout(Duration(seconds: kTimeOutDuration));
我收到一个错误:Uri.encodeFull('$kBaseUrl/LoginService/CheckLogin'
“参数类型'String'不能分配给参数类型'Uri'。”
$kBaseUrl = 'https://subdom.mydomain.com:443/mobile';
我需要改变什么?
【问题讨论】: