getx flutter controller code example
Example 1: getx flutter finding controller in widgets
//it uses in top level widget and controller is availlable to its child widget tree
final Your_Controller c = Get.put(Your_Controller());
// to find that controller in child widget where it finds to use controller..
final Your_Controller c = Get.find();
Example 2: getx flutter
In the dependencies section of pubspec.yaml, add get: as shown below
dependencies:
get:
Example 3: getx flutter
dependencies:
get: ^3.25.4