available static method

Set<IsoCode> available(
  1. OperationDepositMethod method
)

Returns IsoCode that are available for the provided OperationDepositMethod.

Implementation

static Set<IsoCode> available(OperationDepositMethod method) {
  final CriteriaCountry? countries = method.countries;

  if (countries == null) {
    return IsoCode.values.toSet();
  }

  if (countries is CriteriaCountryOnly) {
    return IsoCode.values
        .where((e) => countries.only.contains(CountryCode(e.name)))
        .toSet();
  }

  if (countries is CriteriaCountryExcept) {
    return IsoCode.values
        .whereNot((e) => countries.except.contains(CountryCode(e.name)))
        .toSet();
  }

  return {};
}