Error: List is not a subtype of type Map

后端 未结 5 1956
一生所求
一生所求 2020-12-09 08:29

I am currently building an app to read data through an api and I am trying to parse a JSON api from JSON Placeholder.

I made a model class for the Users (users_futur

5条回答
  •  生来不讨喜
    2020-12-09 08:51

    Just pay attention to the error

    List is not a subtype of type Map
    

    basically it means the data which you are receiving after hitting a webservice is in form of List but inside data class which you have used is of type Map .So, it is unable to parse the data due to structure mismatch as Map is defined in instead of List in data class.

    Recheck your Json response and corresponding PODO class

提交回复
热议问题