Trying to use GetX framework to implement Global state management system, but it's not getting update inside the Widget as soon as the state value updated.
Trying to use GetX framework to implement Global state management system, but it's not getting update inside the Widget as soon as the state value updated.
RxInt number = 0.obs;
@override
Widget build(BuildContext context) {
return Column(
children: [
Obx(() => Text(number.value.toString())),
TextButton(
onPressed: () {
number.value++;
},
child: const Text('+1'),
)
],
);
}