fix search with localization and move elemen localization

This commit is contained in:
Salvatore Giordano
2020-04-04 14:13:04 +02:00
parent 16f09e5ecf
commit 1e9495cf24
4 changed files with 11 additions and 21 deletions

View File

@@ -59,13 +59,9 @@ class CountryCode {
@override
String toString() => "$dialCode";
String toLongString([BuildContext context]) =>
"$dialCode ${toCountryStringOnly(context)}";
String toLongString() => "$dialCode ${toCountryStringOnly()}";
String toCountryStringOnly([BuildContext context]) {
if (context != null) {
return CountryLocalizations.of(context)?.translate(code) ?? name;
}
String toCountryStringOnly() {
return '$name';
}
}