compareTo method
Compares this WalletAction to other
, based on their timestamps.
Returns:
- A positive integer if this WalletAction is greater than
other
. - A negative integer if this WalletAction is less than
other
. - 0 if this WalletAction is equal to
other
.
Implementation
@override
int compareTo(WalletAction? other) {
if (other == null) return 1;
return timestamp.compareTo(other.timestamp);
}