encodedBy<T> method
Encodes a Money instance as a
Create your own encoders to convert a Money instance to any other type. You can use this to format a Money instance as a string.
Implementation
/// You can use this to format a [Money] instance as a string.
///
/// <T> - the type you want to encode the [Money]
/// Returns this money representation encoded by [encoder].
T encodedBy<T>(MoneyEncoder<T> encoder) =>
encoder.encode(MoneyData.from(amount, currency));