Flutter get " type 'List' is not a subtype of type 'Map' in type cast error

后端 未结 1 773
走了就别回头了
走了就别回头了 2021-01-25 21:52

Out webserver return this result as:

[
  {
    \"id\": 1,
    \"user_id\": 10,
    \"title\": \"xxxxxxx\",
    \"description\": \"xxxx\",
    \"type\": \"post\",         


        
相关标签:
1条回答
  • 2021-01-25 22:37

    as @Richard Heap comment, changing

    CategoriesModel categories;
    

    to

    List<CategoriesModel> categories;
    

    resolve this problem

    0 讨论(0)
' is not a subtype of type 'Map' in type cast error" id="ans_title" name="title">
提交回复
热议问题