make controller extends from RxController as it is good practice
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -24,7 +24,7 @@ | @@ -24,7 +24,7 @@ | ||
24 | ```dart | 24 | ```dart |
25 | void main() => runApp(GetMaterialApp(home: Home())); | 25 | void main() => runApp(GetMaterialApp(home: Home())); |
26 | // Create your business logic class and place all variables, methods and controllers inside it. | 26 | // Create your business logic class and place all variables, methods and controllers inside it. |
27 | -class Controller { | 27 | +class Controller extends RxController{ |
28 | // ".obs" turns any object into an observable one. | 28 | // ".obs" turns any object into an observable one. |
29 | var count = 0.obs; | 29 | var count = 0.obs; |
30 | increment() => count.value++; | 30 | increment() => count.value++; |
-
Please register or login to post a comment