Questions tagged [json-annotation]

20 questions
0
votes
0 answers

Use Variables in JSON and deserialize in POJO based on section

I have defined an example JSON below- { "common" : { "data" : [ { "ref" : "data1" "x" : "${variable1}", }, { "ref" : "data2" "y" : "${variable2}" } ] }, "section1" : { "variables" : { …
tg_anon
  • 231
  • 1
  • 3
  • 6
0
votes
1 answer

Can we use json_serializable package to serialize and deserialize user models?

After generating part 'UserModel.g.dart'; successfully, I got the following error upon trying to do if (user != null) { var uid = user.providerData.first.uid; var displayName = user.providerData.first.displayName; var email =…
Jagadish Nallappa
  • 814
  • 1
  • 10
  • 11
0
votes
1 answer

Flutter retrofit DioError [DioErrorType.other]: Expected a value of type 'List?', but got one of type 'String'

My response json is bellow [ { "cat_id":"517", "categoryName":"Pizza", "item" : [ { "itemId" : "1", "name": "Pizza 1", "price": 50 }, { "itemId":"2", "name" :"Pizza 2", "price": 40 } …
Enamul Haque
  • 4,789
  • 1
  • 37
  • 50
0
votes
4 answers

flutter json_serializable missing file

i don't seem to understand why it is showing the error i have created two different .g.dart files but for this file it shows missing part. [WARNING] json_serializable:json_serializable on lib/Model/Supermodel.dart: Missing "part…
user14473358
0
votes
1 answer

flutter run pub run build_runner build failed

[used json annotation and serializable ][1] [Not understanding the error][2]
user14473358
1
2