0

Currently, I'm doing nested JsonDeserialize using built_value and build_runner. It showing error on generated serailize.g.dart. How do i solve this kind of issue?. I also put it built_collection in pubspec.yaml

this is generated file

It fine for original file.

enter image description here

My usage is to parse JSON like this.

[
  {
    "id": "some-id",
    "urls": {
      "small": "some-url"
    },
    "user": {
      "username": "some-username"
    }
  },
  //more object comming
]

That' why, i prepared my Dart Model class to Following

enter image description here

photo.dart

enter image description here

amlwin
  • 4,059
  • 2
  • 15
  • 34
  • 2
    Just to clarify, did you add the following to `serializers.dart`: `import 'package:built_collection/built_collection.dart';`? For future posts, it is a better approach to add code as snippets rather than images. And, for this case it would have been nice to se which files you are importing as well. – flarkmarup Jul 01 '19 at 09:26
  • Ohh. Thanks. I'll update – amlwin Jul 01 '19 at 09:54

0 Answers0