compareTo method
Implementation
@override
int compareTo(covariant Money other) {
if (currency != other.currency) {
throw const FormatException(
'You cannot compare two moneys with different currencies. Before'
' comparing, convert one of them.');
}
// Last comparison
final int comparison1 = amount.compareTo(other.amount);
return comparison1;
}