How to Deserialize a list of objects from json in flutter

后端 未结 8 1066
无人共我
无人共我 2020-12-04 19:30

I am using the dart package json_serializable for json serialization. Looking at the flutter documentation it shows how to deserialize a single object as follow:

<         


        
8条回答
  •  春和景丽
    2020-12-04 19:38

    follow this step
    step 1-> create model class (name as LoginResponce ) click here to convert json to dart .
    step 2-> LoginResponce loginResponce=LoginResponce.fromJson(json.decode(response.body));

    step 3 -> now you get your data in instence of model (as loginResponce ).

提交回复
热议问题