operator == method
Value-equal, exactly (stored values, CLAUDE.md), but not uniformly:
- the ends and the kind with
==, so a FixedEnd's coordinates are compared with double==:-0.0and0.0are the same coordinate, and a NaN coordinate equals nothing; - the offset with
compareTo(other.offset) == 0(D2, R-2), because its sign bit is its side:-0.0differs from+0.0(where-0.0 == 0.0is true in Dart), and a NaN offset equals itself.
Implementation
@override
bool operator ==(Object other) =>
other is DimensionParams &&
other.a == a &&
other.b == b &&
other.kind == kind &&
other.offset.compareTo(offset) == 0;