clean name

This commit is contained in:
Salvatore Giordano
2021-03-13 12:37:04 +01:00
parent 4e8b890381
commit 01aa7502cc
3 changed files with 61 additions and 52 deletions

View File

@@ -69,6 +69,10 @@ class CountryCode {
String toLongString() => "$dialCode ${toCountryStringOnly()}";
String toCountryStringOnly() {
return '$name';
return '$_cleanName';
}
String? get _cleanName {
return name?.replaceAll(RegExp(r'[[\]]'), '').split(',').first;
}
}