We will explore four ways to go back to previous routes. First way we will explore the native way. Flutter AppBar takes IconButton or any widget that takes onPress or onTap event. Inside event set And you are good to go. So the actual code would look like this Second way If you use Getx…
Month: October 2022
Flutter HydratedCubit A Cubit And BLoC State Management Package
HydratedCubit A specialized Cubit which handles initializing the Cubit state based on the persisted state. This allows state to be persisted across application restarts. With HydratedCubit you can load JSON data and store JSON data locally. Your HydratedCubit class may look like this Since you want to manage storage using HydratedCubit, your Cubit class must…
Flutter Getx Routing Compare With Native Routing
Here I uncovered Get.until Remove screens until satisfying the condition. It’s the same with Navigation.popUntil(). You can use it like Get.until((route) => Get.currentRoute == ‘/home’). Get.off Remove the current screen and add a new screen. It’s the same with Navigation.pushReplacement(). You can use it like Get.off(Second()). Get.offNamed By the Named route, remove the current screen and add a new…
Difference between Get.offNamedUntil() and Get.offAllNamed()
Get.offAllNamed() removes all the previous routes and goes to the new routes. But if you want better control, then you should be using Get.offNamedUntil. By using Get.offNamedUntil() you can control upto which routes to remove from the stack. See the above code, it will take you to a new route name AppIntroductionScreen. OffNamedUntil will remove…
Flutter Timer App With Getx
Learn how to build a timer app using Getx. Create a controller and declare variables like below In the Controller we declared Timer object _timer, and remainSeconds for checking on the remaining seconds and then a time variable. This time variable would be reactive. It means we Timer object’s return value would be saved time…