- Get is an extra-light and powerful solution for Flutter. It combines high performance state management, intelligent dependency injection, and route management in a quick and practical way.
- Get is not for everyone, its focus is (performance) on the minimum consumption of resources, (productivity) using an easy and pleasant syntax and (organization) allowing the total decoupling of the View from the business logic.
- Get is not for everyone, its focus is (performance) on the minimum consumption of resources ([look the benchmarks](https://github.com/jonataslaw/benchmarks)), (productivity) using an easy and pleasant syntax and (organization) allowing the total decoupling of the View from the business logic.
- Get will save hours of development, and will extract the maximum performance that your application can deliver, being easy for beginners, and accurate for experts. Navigate without context, open dialogs, snackbars or bottomsheets from anywhere in your code, Manage states and inject dependencies in an easy and practical way. Get is secure, stable, up-to-date, and offers a huge range of APIs that are not present on default framework.
**Get makes your development productive, but want to make it even more productive? Add the extension [Get extension to VSCode](https://marketplace.visualstudio.com/items?itemName=get-snippets.get-snippets) to your VSCode**
**The "counter" project created by default on new project on Flutter has over 100 lines (with comments). 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.**
The "counter" project created by default on new project on Flutter has over 100 lines (with comments). 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.
- Step 1:
Add "Get" before your materialApp, turning it into GetMaterialApp
```dart
voidmain()=>runApp(GetMaterialApp(home:Home()));
// Create your business logic class and place all variables, methods and controllers inside it.
```
- Step 2:
Create your business logic class and place all variables, methods and controllers inside it.
You can make any variable observable using a simple ".obs".
```dart
classControllerextendsRxController{
// ".obs" turns any object into an observable one.
varcount=0.obs;
varcount=0.obs;
increment()=>count.value++;
}
```
- Step 3:
Create your View, use StatelessWidget and save some RAM, with Get you may no longer need to use StatefulWidget.
```dart
classHomeextendsStatelessWidget{
// Instantiate your class using Get.put() to make it available for all "child" routes there.
finalControllerc=Get.put(Controller());
@override
Widgetbuild(context)=>Scaffold(
appBar:
AppBar(title:Obx(()=>Text("Total of clicks: "+c.count.string))),
// Use Obx(()=> to update Text() whenever count is changed.