fix localization

This commit is contained in:
Salvatore Giordano
2020-03-08 23:30:49 +01:00
parent d17678dc8d
commit 28e5cd8a7f
5 changed files with 33 additions and 5 deletions

View File

@@ -41,6 +41,12 @@ class CountryCode {
return CountryCode.fromJson(jsonCode);
}
CountryCode localize(BuildContext context) {
return this
..name =
CountryLocalizations.of(context)?.translate(this.code) ?? this.name;
}
factory CountryCode.fromJson(Map<String, dynamic> json) {
return CountryCode(
name: json['name'],