operator == method

  1. @override
bool operator ==(
  1. dynamic other
)
override

The quantity operator

Comparison depends on Currency.number field

UnknownCurrency never equals to anything, even itself, except the exactly same instance

Use Currency.dummy for money manipulations which don't involve currency

Implementation

@override
bool operator ==(dynamic other) {
  if (identical(this, other)) return true;
  if (other is! Currency) return false;
  if (this is UnknownCurrency || other is UnknownCurrency) return false;
  return number == other.number;
}