I have two forms in a tab bar. I'm using Getx for state management. All fields in those forms listen to a .obs variable. The forms fields are updating to the variable changes. How ever one field only reflect changes when that page is revisited.
I'm using this variables
final _countryCode = ''.obs
String get countryCode => _countryCode.value;
final _phone = ''.obs
String get phone => _countryCode.value;
These variable are updated on init.
void onInit(){
super.onInit();
_countryCode(user.countryCode); // assign country code
_phone(user.number); // assign number
}
return Obx(() => IntlPhoneField(
final UserController _controller = Get.find()
enabled: true,
showCountryFlag: false,
iconPosition: IconPosition.trailing,
autoValidate: false,
initialValue: _controller.initialPhoneNumber,
initialCountryCode: _controller.userCountryCode,
);
How ever this field is not updating on init. but updates after that page is revisited.. What's causing this? All other fields are updating without any issue. But this one will update only if its revisited. How can i solve this??