findByCode method
Returns the first country that mach the given code.
Implementation
Country? findByCode(String? code) {
final uppercaseCode = code?.toUpperCase();
return _countries
.firstWhereOrNull((country) => country.countryCode == uppercaseCode);
}