While we serialize or de-serialize the model using jsonSerializable in Flutter it converts the DateTime as String
class Task {
final DateTime dateTime;
final String taskName;
Task({
required this.dateTime,
required this.taskName
}):
}
Instead of converting as string it should convert as TimeStamp
3
Answers
Try with this:
Use
@JsonKey
. This is a sample from json_serializable :