Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonSerializableGenerator Generated code issue #13

Open
gerryau opened this issue Jun 12, 2020 · 0 comments
Open

JsonSerializableGenerator Generated code issue #13

gerryau opened this issue Jun 12, 2020 · 0 comments

Comments

@gerryau
Copy link

gerryau commented Jun 12, 2020

My code generation seems to be missing the .map function for the todos in the generated file

Map<String, dynamic> _$_$_NoteDtoToJson(_$_NoteDto instance) =>
    <String, dynamic>{
      'body': instance.body,
      'color': instance.color,
      //  'todos': instance.todos, <- my code generation looks like this
      'todos': instance.todos?.map((e) => e?.toJson())?.toList(),
      'serverTimeStamp':
          const ServerTimestampConverter().toJson(instance.serverTimeStamp),
    };

What part of your code controls this generation to map it like this? My code works if I manually change this.

Running the same version of json_serializable and json_annotation as you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant