GaspardMerten / date_range_picker

Date Range Picker is a user-friendly and simple package for Flutter that allows users to select a date range. It's designed to evolve over time, and its components are built to be reusable.
MIT License
12 stars 31 forks source link

toJson and fromJson functions not provided #13

Closed yassineben22 closed 8 months ago

yassineben22 commented 9 months ago

Hello,

While working on my code today, I noticed that the TimeRange class and TimeOfDay class do not have the toJson and fromJson functions implemented. As a result, I had to create these functions in another class, which is not the most optimal solution. Could you please consider adding these functions to the original classes? Your assistance would be greatly appreciated.

Thank you!

GaspardMerten commented 8 months ago

I would suggest using https://pub.dev/packages/json_serializable or something similar and implementing the logic using it. This logic should not be coupled with the code of the package since toJson might be implemented in various ways, depending on backend and choices.