nameContainsFunc method

dynamic nameContainsFunc(
  1. String name, {
  2. String? lang,
})

Implementation

nameContainsFunc(String name, {String? lang}) =>
    (Country country) => lang == null || lang.toLowerCase() == 'en'
        ? country.name?.toLowerCase().contains(name.toLowerCase()) == true
        : country.translations?[lang]
                ?.toLowerCase()
                .contains(name.toLowerCase()) ==
            true;