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

Problem with defaultValue as function with DateTime #1219

Closed
kevmoo opened this issue Oct 7, 2022 · 1 comment · Fixed by #1220
Closed

Problem with defaultValue as function with DateTime #1219

kevmoo opened this issue Oct 7, 2022 · 1 comment · Fixed by #1220

Comments

@kevmoo
Copy link
Collaborator

kevmoo commented Oct 7, 2022

Hrm...

  @JsonKey(defaultValue: DateTime.now)
  DateTime funWithDateTime;

with a required param creates

      funWithDateTime:
          DateTime.parse(json['funWithDateTime'] as String) ?? DateTime.now(),

Which is not good!

@kevmoo
Copy link
Collaborator Author

kevmoo commented Oct 7, 2022

See #1185 (comment)

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

Successfully merging a pull request may close this issue.

1 participant