operator == method
The equality operator.
Two OffsetDateTimes compare equal if and only if they have the same
date and the same offset. If you want to know if two represent the
same moment in time, use compareTo or toInstant.
// Same moment in time; different zone offsets:
var d1 = OffsetDateTime(ZoneOffset(0), 2023, 1, 1);
var d2 = OffsetDateTime(ZoneOffset(-1), 2022, 12, 31, 23);
d1 != d2;
d1.compareTo(d2) == 0;
d1.toInstant() == d2.toInstant();
Implementation
@override
bool operator ==(Object other) =>
other is OffsetDateTime &&
_secondPart == other._secondPart &&
_nanosecondPart == other._nanosecondPart &&
offset == other.offset;