Back to Blog
Gitx center7/7/2023 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. With GetX you know where to find each feature of your application, having clean code by default. In addition to making maintenance easy, this makes the sharing of modules something that until then in Flutter was unthinkable, something totally possible.īLoC was a starting point for organizing code in Flutter, it separates business logic from visualization. GetX is a natural evolution of this, not only separating the business logic but the presentation logic. Bonus injection of dependencies and routes are also decoupled, and the data layer is out of it all. You know where everything is, and all of this in an easier way than building a hello world. GetX is the easiest, practical, and scalable way to build high-performance applications with the Flutter SDK. It has a large ecosystem around it that works perfectly together, it's easy for beginners, and it's accurate for experts. It is secure, stable, up-to-date, and offers a huge range of APIs built-in that are not present in the default Flutter SDK. It has a multitude of features that allow you to start programming without worrying about anything, but each of these features are in separate containers and are only started after use. If you only use State Management, only State Management will be compiled. If you only use routes, nothing from the state management will be compiled. GetX has a huge ecosystem, a large community, a large number of collaborators, and will be maintained as long as the Flutter exists. GetX too is capable of running with the same code on Android, iOS, Web, Mac, Linux, Windows, and on your server. It is possible to fully reuse your code made on the frontend on your backend with Get Server. In addition, to further increase your productivity, we have theĮxtension to VSCode and the extension to Android Studio/Intellij Installing #Īdd Get to your pubspec.yaml file: dependencies: In addition, the entire development process can be completely automated, both on the server and on the front end with Get CLI. Import get in files that it will be used: import 'package:get/get.dart' #GITX FOR WINDOWS ANDROID# To show the power of Get, I will demonstrate how to make a "counter" changing the state with each click, switching between pages and sharing the state between screens, all in an organized way, separating the business logic from the view, in ONLY 26 LINES CODE INCLUDING COMMENTS.Īdd "Get" before your MaterialApp, turning it into GetMaterialApp The "counter" project created by default on new project on Flutter has over 100 lines (with comments). Void main() => runApp(GetMaterialApp(home: Home())) #GITX FOR WINDOWS HOW TO# Note: this does not modify the MaterialApp of the Flutter, GetMaterialApp is not a modified MaterialApp, it is just a pre-configured Widget, which has the default MaterialApp as a child. You can configure this manually, but it is definitely not necessary.
0 Comments
Read More
Leave a Reply. |