Flutter 報錯 Expected a value of type 'List<String>', but got one of type 'List<dynamic>'
服務端返回的數(shù)據(jù)是List<dynamic> callback給業(yè)務的時候想返回一個List<String>類型的
解決方法如下
var hotwords = (response["hotwords"] as List)
?.map((item) => item as String)
?.toList();
需要的老鐵可以拿去用