getCurrencyCode method

CurrencyCode getCurrencyCode(
  1. String code
)

Returns the CurrencyCode based on code

Implementation

CurrencyCode getCurrencyCode(String code) {
  return PaylikeCurrencyCollection.currencies.entries
      .firstWhere((element) => element.value.code == code,
          orElse: () => throw MissingCurrencyException.fromStringCode(code))
      .key;
}