Search code examples
flutterflutter-getxflutter-state

What is GetX Controller?


I am new with getX and I don't understand what is the purpose of GetX Controller. Based on my understanding, It basically hold variables and this is where everything changes inside the state. Can someone explain further


Solution

  • Rather than holding variables for state change, it provides observability. It allows declaring a variable as observable, which is by using .obs and the whole class elements can be under control or operatable. To make it work you should initialize it by using Get.put or the LazyPut method.

    For more, refer this video.