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

前端 未结 9 736
夕颜
夕颜 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:36

    as doesn't change the type, it's just an assertion.

    You need to use map['eventType'].cast() or Map.from(map['eventType'])

    You can also solved by this way:

    Map myMap = new Map.from(/*Your Source*/ );
    

提交回复
热议问题