0

Could you explain what does the .obs function do?

RxInt _questionNumber = 1.obs;
rozerro
  • 5,787
  • 9
  • 46
  • 94

3 Answers3

2

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.

S. M. JAHANGIR
  • 4,324
  • 1
  • 10
  • 30
0

it makes the value observable from anywhere in the app

Subair K
  • 1,760
  • 1
  • 11
  • 31
0

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.