You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are many issues on this already but I'll just illustrate it quite simply. The way dart_mappable handles dates out-of-the-box is unlike anything I've ever seen in a serialization package. Quite simply, any model with a DateTime cannot pass equality checks after it's been serialized and deserialized.
@MappableClass()
classDateTimeExamplewithDateTimeExampleMappable {
finalDateTime timestamp;
DateTimeExample({requiredthis.timestamp});
}
voidmain() async {
final x =DateTimeExample(timestamp:DateTime(2020));
final json = x.toJson();
final x2 =DateTimeExampleMapper.fromJson(json);
print("this should be true, it's ${x == x2}"); // "false"
}
The text was updated successfully, but these errors were encountered:
There are many issues on this already but I'll just illustrate it quite simply. The way
dart_mappable
handles dates out-of-the-box is unlike anything I've ever seen in a serialization package. Quite simply, any model with a DateTime cannot pass equality checks after it's been serialized and deserialized.The text was updated successfully, but these errors were encountered: