State management with Getx in flutter

GETX 

Application improvement with Flutter is genuinely magnificent and simple since it gives a rich arrangement of adaptable widgets.





this article, we will explore the .We will see how to implement a demo program. I would like to explain GetX, a powerful flutter framework, and learn how to use the  package in your flutter applications.

GetX uses an easy and pleasant syntax. No matter what you want to do, there is always an easier way with GetX. It will save hours of development and will provide the maximum performance your application can deliver.


GetX allows the total decoupling of the View, presentation logic, business logic, dependency injection, and navigation. You do not need context to navigate between routes, so you are not dependent on the widget tree (visualization) for this. You don't need context to access your controllers/blocs through an inheritedWidget, so you completely decouple your presentation logic and business logic from your visualization layer. You do not need to inject your Controllers/Models/Blocs classes into your widget tree through MultiProviders. For this, GetX uses its own dependency injection feature, decoupling the DI from its view completely.



Lets see how can we manage routes With GETx

- Routes management is very  easy and short with getx because every developer are lazy and someone said lazy people have smart ideas to complete there works easily


 # How you can Navigate one page to other page with Get x 
    Ex: 
Get.to(SecondScreen());

 #Navigate to new screen with name. See more details on named             routes here Ex: Get.toNamed('/secondScreen');

To close snackbars, dialogs, bottomsheets, or anything you would normally close with Navigator.pop(context);
Now with getx you can use Get.back(); instead of  
Navigator.pop(context); 

Thats very easy right!!!!!!!

Yuppppppy.....


To go to the next screen and no option to go back to the previous screen (for use in SplashScreens, login screens, etc.)

Get.off(NextScreen());

To go to the next screen and cancel all previous routes (useful in shopping carts, polls, and tests)

Get.offAll(NextScreen());
 


Thank you Guys.....


If you want to know how can we create a project with getx comment me i will create a blog for that

Thanks 🙏 



Comments

Popular Posts