Could you explain what does the .obs
function do?
RxInt _questionNumber = 1.obs;
Could you explain what does the .obs
function do?
RxInt _questionNumber = 1.obs;
It makes questionNumber
an observable variable. Which means that whenever the value of that variable changes, that change will be automatically reflected on all places where it's being used.
It's like listening to a stream.
it means your _questionNumber variable is now observable variable. for show this variable data just wrap Print(_questionNumber.value) in Obx. it will be helpful.