findByCode method

Currency? findByCode(
  1. String? code
)

Returns the first currency that mach the given code.

Implementation

Currency? findByCode(String? code) {
  final uppercaseCode = code?.toUpperCase();
  return _currencies
      .firstWhereOrNull((currency) => currency.code == uppercaseCode);
}