In GetX we have Reactive State Management and Simple State Management. Names are, IMHO, a bit misleading, as they are both reactive in some sense, but the first uses streams, and the second uses callbacks. The second was declared to be more performance-friendly. Examples:
First (with streams)
class Controller extends GetxController {
var count = 0.obs;
increment() {
count.value++;
}
}
It should be consumed using Obx
or GetX
widgets.
Second (with callbacks)
class Controller extends GetxController {
int counter = 0;
void increment() {
counter++;
update();
}
}
It should be consumed using the GetBuilder
widget alone.
Now, the question is:
Are there both stream/callback approaches in Riverpod?
Can you provide analog examples of the above?