flutter_in_action_2nd icon indicating copy to clipboard operation
flutter_in_action_2nd copied to clipboard

最后的实例中,代码出现了很多小问题

Open bewaternow opened this issue 2 years ago • 2 comments

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'

我是初学者,所以对于书中的问题,通常不敢轻易论断。

bewaternow avatar Apr 08 '22 09:04 bewaternow

merge好像方法找不到了。我使用copyWith方法代替的,可以跑起来

shixueqian avatar Apr 18 '22 03:04 shixueqian

初学者,折腾了很久, 抓包没效果。

Git([this.context]) {
    _options = Options(extra: {"context": context});

  // 居然这里要手动加上下面的代码才能在Charles里抓包
  init();
}

songxing10000 avatar May 21 '22 14:05 songxing10000