tryParseCountryName static method
Country?
tryParseCountryName(
- String countryName, {
- BuildContext? context,
- List<
Locale> ? locales,
Returns a single country if it matches the given countryName
.
Returns null if no matching element is found.
Implementation
static Country? tryParseCountryName(
String countryName, {
BuildContext? context,
List<Locale>? locales,
}) {
try {
return parseCountryName(countryName, context: context, locales: locales);
} catch (_) {
return null;
}
}