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.
Asked
Active
Viewed 29 times
-1
-
Have use used GetBuilder or Obx? – Sugan Pandurengan Sep 20 '22 at 16:01
-
share your snippet and what you tried – mohammad esmaili Sep 20 '22 at 16:47
-
Please provide enough code so others can better understand or reproduce the problem. – Community Sep 21 '22 at 04:23
1 Answers
0
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'),
)
],
);
}

HasanToufiqAhamed
- 751
- 1
- 5
- 17