changeSelectCountry method
Implementation
changeSelectCountry(
{required Country newCountry, required BuildContext context}) {
selectedCountry = newCountry;
if ((phoneNumber.phoneNumber ?? "").isNotEmpty &&
(phoneNumber.phoneNumber ?? "").contains("-")) {
String newPhoneNumber =
"${selectedCountry?.dialCode}-${phoneNumber.phoneNumber!.toLowerCase().split("-")[1]}";
phoneNumber = PhoneNumber(
phoneNumber: newPhoneNumber,
isoCode: "",
dialCode: selectedCountry?.dialCode,
);
}
resetFilter();
update();
Navigator.pop(context);
}