List '不是'String]类型的子类型>

问题描述 投票:0回答:1

Estoy enviando esta peticion y me sale este error en la consoloa:List'不是'String类型的子类型>>

最终响应=等待http.get(url,标头:{“ userId”:userId});最终解析= jsonDecode(response.body);

  if (response.statusCode == 200) {

    final List<dynamic> scheduleJsonList = json.decode(parsed);
    final todos = todosJsonList.map((e) => ScheduleUser.fromJson(e)).toBuiltList();


     logger.i('scheduleResponse');
     logger.v(scheduleResponse);
     logger.i('todos');
     print('todos');
  }

Estoy enviando esta peticion y me sale este error en la consoloa:List'不是'String final response = await http.get(url,headers:{“ userId”:userId})类型的子类型。最终解析= ...

json flutter serialization dart provider
1个回答
0
投票

'parsed'是json吗?您必须更改代码。final String scheduleJsonList = json.decode(parsed);要么final List<dynamic> scheduleJsonList = somethingToDoParse(parsed);

© www.soinside.com 2019 - 2024. All rights reserved.