epam-cross-platform-lab / swagger-dart-code-generator

Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter
Apache License 2.0
261 stars 119 forks source link

[QUESTION] Can I create a custom JsonConverter to support datetime conversion to native methods #750

Open trtiger4520 opened 4 months ago

trtiger4520 commented 4 months ago

I currently save a lot of time using this package on my application.

But I found that I want to use the time field to default to UTC time zone. Is there a way to make the time convertible to local Avoid editing automatically generated content or repeatedly manually converting to local time zone

For example, I can write a custom JsonConverter method

https://github.com/google/json_serializable.dart/issues/1420#issue-2262511802