getCountryBy method
Implementation
Future<Country?> getCountryBy(bool Function(Country) fun,
{bool firstCache: true, bool onErrorTryCache: false}) async =>
(await getCountries(firstCache: firstCache))?.fold(
null,
(acc, country) => acc != null
? acc
: fun(country)
? country
: null);