built-value

Flutter display nested json in ListView return type String is not a subtype of type 'Map<String, dynamic>' in type cast

╄→гoц情女王★ 提交于 2021-02-10 14:44:22
问题 I' m going on with my journey in Flutter. I' m able to display a simple json in a ListView. Now I' m trying with a json with nested objects but everytime I run the app I get the error I' m generating the code for json model classes like suggested in Flutter official documentation. The error seems to happen when I' m parsing the User. While debugging, I see that name and surname are successfully parsed, but when I jump to the details object in user.g.dart at the row: json['details'] == null ?

Flutter display nested json in ListView return type String is not a subtype of type 'Map<String, dynamic>' in type cast

爷,独闯天下 提交于 2021-02-10 14:42:36
问题 I' m going on with my journey in Flutter. I' m able to display a simple json in a ListView. Now I' m trying with a json with nested objects but everytime I run the app I get the error I' m generating the code for json model classes like suggested in Flutter official documentation. The error seems to happen when I' m parsing the User. While debugging, I see that name and surname are successfully parsed, but when I jump to the details object in user.g.dart at the row: json['details'] == null ?