flutter_in_action_2nd
flutter_in_action_2nd copied to clipboard
最后的实例中,代码出现了很多小问题
Git([this.context]) {
_options = Options(extra: {"context": context});
}
The parameter 'context' can't have a value of 'null' because of its type, but the implicit default value is 'null'.
options: _options.merge(headers: {
HttpHeaders.authorizationHeader: basic
}, extra: {
"noCache": true, //本接口禁用缓存
}),
Dio The method 'merge' isn't defined for the type 'Options'
我是初学者,所以对于书中的问题,通常不敢轻易论断。
merge好像方法找不到了。我使用copyWith方法代替的,可以跑起来
初学者,折腾了很久, 抓包没效果。
Git([this.context]) {
_options = Options(extra: {"context": context});
// 居然这里要手动加上下面的代码才能在Charles里抓包
init();
}