computeCountryCode static method

String? computeCountryCode(
  1. OpenFoodFactsCountry? country,
  2. String? cc
)

Returns the most relevant country code

Implementation

static String? computeCountryCode(
  final OpenFoodFactsCountry? country,
  final String? cc,
) {
  if (country != null) {
    return country.offTag;
  }
  if (globalCountry != null) {
    return globalCountry!.offTag;
  }
  if (cc != null) {
    return cc;
  }
  return null;
}