ListMoneyTransactionX extension
This extension provides additional functionality for
List<MoneyTransaction>
.
- on
Methods
-
addMoneyTransaction(
MoneyTransaction moneyTransaction) → void -
Adds the
moneyTransaction
to this list if the latter does not already contain it. Also, sorts it. -
compareTo(
List< MoneyTransaction> other) → int -
Returns the comparison to
other
list ofMoneyTransaction
. -
fromList(
List list) → List< MoneyTransaction> -
Fills this list starting from the
List<dynamic>
list
. -
normalize(
{required Currency currency, List< ExchangeRate> ? exchangeRates}) → List<MoneyTransaction> -
Normalizes all values to the same
currency
. For this,exchangeRates
list must contain all the exchange rates necessary for conversions. If even one of these is missing, throws aFormatException
. -
toListOfMaps(
) → List< Map< String, dynamic> > -
Creates a
List<Map<String, dynamic>>
representation of this list. -
total(
{required Currency currency, List< ExchangeRate> ? exchangeRates, DateTime? from, ExpenseOrIncome? expenseOrIncome, DateTime? until}) → Money - Calculates and returns the sum of all transactions of this list. Also, allows to perform the sum of only expenses or only income. It is also possible to limit the sum to a time interval.
-
whoseMethodWas(
{Currency? currency, List< ExchangeRate> ? exchangeRates, required MoneyTransactionMethod method, bool normalized = false}) → List<MoneyTransaction> -
Returns a filtered list of all the transactions in whose method was
method
. The result is already sorted. -
withValueEqualTo(
{Currency? currency, List< ExchangeRate> ? exchangeRates, bool normalized = false, required Money value}) → List<MoneyTransaction> -
Return a filtered list of all the transactions with a value =
value
. -
withValueGreaterThan(
{Currency? currency, List< ExchangeRate> ? exchangeRates, bool normalized = false, required Money value}) → List<MoneyTransaction> -
Return a filtered list of all the transactions with a value >
value
. -
withValueGreaterThanOrEqualTo(
{Currency? currency, List< ExchangeRate> ? exchangeRates, bool normalized = false, required Money value}) → List<MoneyTransaction> -
Return a filtered list of all the transactions with a value >=
value
. -
withValueLessThan(
{Currency? currency, List< ExchangeRate> ? exchangeRates, bool normalized = false, required Money value}) → List<MoneyTransaction> -
Return a filtered list of all the transactions with a value <
value
. -
withValueLessThanOrEqualTo(
{Currency? currency, List< ExchangeRate> ? exchangeRates, bool normalized = false, required Money value}) → List<MoneyTransaction> -
Return a filtered list of all the transactions with a value <=
value
.