If you use GetX and your controller instantiated with Get.put() or Get.put() not with fenix:true or permanent:true, That controller instance should be auto disposed. The default behavior is that you if you instantiate your controller Get.put(), it must be auto disposed. Learn the advanced usage of GetX here But there might be situations or bug…
Category: Flutter Getx
[Get] the improper use of a GetX has been detected
GetX and Obx() class may get you the below error [Get] the improper use of a GetX has been detected.You should only use GetX or Obx for the specific widget that will be updated.If you are seeing this error, you probably did not insert any observable variables into GetX/Obxor insert them outside the scope that…
Is Riverpod overrated? Is it difficult?
Yes, it’s overrated and difficult for beginners. Now, I am not saying this because I love other state management package or hate Riverpod. It causes problem and impossible to keep track of the error once you use Notifier Provider and AsyncNotifier Provider together. Riverpod does come with it’s benefit. Like AsyncLoading, AsyncData, AsyncValue. These are…
Getx Make Class, Object and Variables Obx
Getx is the most popular state management package of Flutter. One of the way you make your variables, classes or objects observable is via obs. To make any kind of variable or object or class observable, you need to use .obs with object or variable or class. In the picture line 4, we see we…
Flutter Getx Custom Tab Bar | Load Data
Here we will learn how to load network data using custom tab bar and getx package during on toggle method. Here we will see how create a custom tab bar and toggle values and load data from network at the same time. So If you want to load data from network and toggle tabs and…
Flutter Getx Find Current Route or Path
If you use Getx, it’s easy to find current route or path in Flutter. Flutter Getx provides one of the best solution for finding your current route in Flutter app. First make sure you installed Getx package and you are wrapping your MaterialApp() using GetMaterialApp(). I use the below syntax to do it Here I…
Flutter Getx Difference Between Get.put(), Get.lazyPut() and Get.putAsync()
If you ever worked with Getx, you will see Get.put(), Get.lazyPut() and Get.putAsync(). Let’s see the difference between them. Get.put() Get.put() is used for inserting controller to memory and it’s get inserted immediately when your app boots. Because Getx will initialize the controller before you use them. It’s not memory efficient. And see the output…
Flutter Getx GetxController or GetxService
You should use GetxController when you want to use data on per open page. If you open the page GetxController will initialize and you will get update data. But if you use GetxService, it will only get initialized once when the app launch first time. And the data would be saved in memory. GetxService may…
Flutter Getx Get.find() inside Controller
A lot of time, you may use Get.find() inside Getx controller. We need that to reduce bipolerate code. We can do that by creating a static method which refers to the current class. All we have to do it is return Get.find(). We created a class name StorageService and extends GetxService. And inside that we…
Flutter Getx Route Management
If you use Getx for routing, it becomes much easier to manage routing. Just create a new dart class and name it RouteHelper.dart This class will contain a routes list of List<GetPage> type. The variable would be static type. Let’s see the class The above RouteHelper class static properties and methods. You may call both…