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()
class DateTimeExample with DateTimeExampleMappable {
final DateTime timestamp;
DateTimeExample({required this.timestamp});
}
void main() 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"
}
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.