【发布时间】:2018-08-15 08:51:19
【问题描述】:
我从 api 接收带有字符串数组的 json。然后我将其设置为 List 类型的局部变量。
if (json['x'] is List) {
List<String> x = json['x'];
print(x);
}
当我运行应用程序时,Chrome 向我显示警告:“Ignoring cast failed from JSArray to List”
我该怎么办?
- Angular 5.0.0-alpha+6
- 铬 63.0.3239.132
- Dart 虚拟机版本:2.0.0-dev.32.0
【问题讨论】:
-
我认为这是来自 DDC,对吧? Dart2 的 dar2js 正在进行中。我想只有在此处也显示警告时才有意义。另见github.com/dart-lang/sdk/blob/…