Unhandled Exception: InternalLinkedHashMap' is not a subtype of type 'List

前端 未结 9 760
夕颜
夕颜 2020-12-15 16:04

I am trying to get the JSON response from the server and output it to the console.

Future login() async {
    var response = await http.get(
            


        
9条回答
  •  心在旅途
    2020-12-15 16:23

    You have to convert the runtimeType of data from _InternalLinkedHashMap to an actual List.

    One way is to use the List.from.

    final _data = List.from(
      data.map(
        (dynamic item) => item,
      ),
    );
    

提交回复
热议问题