Generates a hash code based on the value and unit.
Ensures objects with the same value and unit have the same hash code.
@override int get hashCode => value.hashCode ^ unit.hashCode;