Professional Documents
Culture Documents
get 4.6.5
Published 11 months ago • getx.site Dart 3 compatible • Latest: 4.6.5 / Prerelease: 5.0.0-release-
candidate-4
SDK FLUTTER PLATFORM ANDROID IOS LINUX MACOS WEB WINDOWS 12.1K
Metadata →
Open screens/snackbars/dialogs without context, manage states and inject dependencies easily
with GetX.
More...
get v4.6.5 build passing style effective dart chat 127 online
popularity likes pub points
slack join chat on Telegram Awesome Flutter
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 1/34
16/05/23, 15.37 get | Flutter Package
Languages:
analyze traffic.
About Get
Installing Learn more Ok, Got it
https://pub.dev/packages/get 2/34
16/05/23, 15.37 get | Flutter Package
GetWidget
GetxService
Breaking changes from 2.0
Why Getx?
Community
Community channels
How to contribute
Articles and videos
About Get
GetX is an extra-light and powerful solution for Flutter. It combines high-performance state
management, intelligent dependency injection, and route management quickly and practically.
GetX has 3 basic principles. This means that these are the priority for all resources in the
library: PRODUCTIVITY, PERFORMANCE AND ORGANIZATION.
PRODUCTIVITY: 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.
Generally, the developer should be concerned with removing controllers from memory.
With GetX this is not necessary because resources are removed from memory when they
are not used by default. If you want to keep it in memory, you must explicitly declare
"permanent: true" in your dependency. That way, in addition to saving time, you are less at
risk of having unnecessary dependencies on memory. Dependency loading is also lazy by
default.
ORGANIZATION: 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
This site uses cookies from Google to deliver and enhance the quality of its services and to
layer. You do not need to inject your Controllers/Models/Blocs classes into your widget
analyze traffic.
tree through MultiProvider s. For this, GetX uses its own dependency injection feature,
decoupling the DI from its view completely.
Learn more Ok, Got it
https://pub.dev/packages/get 4/34
16/05/23, 15.37 get | Flutter Package
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. BLoC
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.
GetX is not bloated. 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, the entire development process can be completely automated, both on the server and
on the front end with Get CLI.
In addition, to further increase your productivity, we have the extension to VSCode and the
extension to Android Studio/Intellij
Installing
Add Get to your pubspec.yaml file:
dependencies:
get:
This site uses cookies from Google to deliver and enhance the quality of its services and to
Import get in files that it will be used:
analyze traffic.
https://pub.dev/packages/get 5/34
16/05/23, 15.37 get | Flutter Package
import 'package:get/get.dart';
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. GetMaterialApp will create
routes, inject them, inject translations, inject everything you need for route navigation. If you
use Get only for state management or dependency management, it is not necessary to use
GetMaterialApp. GetMaterialApp is necessary for routes, snackbars, internationalization,
bottomSheets, dialogs, and high-level apis related to routes and absence of context.
Note²: This step is only necessary if you gonna use route management ( Get.to() ,
Get.back() and so on). If you not gonna use it then it is not necessary to do step 1
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".
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze
Steptraffic.
3: Create your View, use StatelessWidget and save some RAM, with Get you may no
longer need to use StatefulWidget.
Learn more Ok, Got it
https://pub.dev/packages/get 6/34
16/05/23, 15.37 get | Flutter Package
@override
Widget build(context) {
// Instantiate your class using Get.put() to make it available for all "child"
final Controller c = Get.put(Controller());
return Scaffold(
// Use Obx(()=> to update Text() whenever count is changed.
appBar: AppBar(title: Obx(() => Text("Clicks: ${c.count}"))),
@override
Widget build(context){
// Access the updated count variable
return Scaffold(body: Center(child: Text("${c.count}")));
}
}
Result:
This is a simple project but it already makes clear how powerful Get is. As your project grows, this
difference will become more significant.
Get was designed to work with teams, but it makes the job of an individual developer simple.
Improve your deadlines, deliver everything on time without losing performance. Get is not for
everyone, but if you identified with that phrase, Get is for you!
https://pub.dev/packages/get 7/34
16/05/23, 15.37 get | Flutter Package
Get has two different state managers: the simple state manager (we'll call it GetBuilder) and the
reactive state manager (GetX/Obx)
Let's imagine that you have a name variable and want that every time you change it, all widgets
that use it are automatically changed.
To make it observable, you just need to add ".obs" to the end of it:
And in the UI, when you want to show that value and update the screen whenever the values
changes, simply do this:
https://pub.dev/packages/get 8/34
16/05/23, 15.37 get | Flutter Package
Route management
If you are going to use routes/snackbars/dialogs/bottomsheets without context, GetX is excellent
for you too, just see it:
Get.to(NextScreen());
Navigate to new screen with name. See more details on named routes here
Get.toNamed('/details');
To close snackbars, dialogs, bottomsheets, or anything you would normally close with
Navigator.pop(context);
Get.back();
To go to the next screen and no option to go back to the previous screen (for use in SplashScreens,
login screens, etc.)
ThisGet.off(NextScreen());
site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
To go to the next screen and cancel all previous routes (useful in shopping carts, polls, and tests)
Learn more Ok, Got it
https://pub.dev/packages/get 9/34
16/05/23, 15.37 get | Flutter Package
Get.offAll(NextScreen());
Noticed that you didn't have to use context to do any of these things? That's one of the biggest
advantages of using Get route management. With this, you can execute all these methods from
within your controller class, without worries.
Dependency management
Get has a simple and powerful dependency manager that allows you to retrieve the same class as
your Bloc or Controller with just 1 lines of code, no Provider context, no inheritedWidget:
Note: If you are using Get's State Manager, pay more attention to the bindings API, which will
make it easier to connect your view to your controller.
Instead of instantiating your class within the class you are using, you are instantiating it within the
Get instance, which will make it available throughout your App. So you can use your controller (or
class Bloc) normally
Tip: Get dependency management is decoupled from other parts of the package, so if for example,
your app is already using a state manager (any one, it doesn't matter), you don't need to rewrite it
all, you can use this dependency injection with no problems at all
controller.fetchApi();
Imagine
This site that
usesyou have navigated
cookies through
from Google numerous
to deliver routes, and
and enhance the you need
quality of data that was
its services lefttobehind
and
in your controller,
analyze traffic. you would need a state manager combined with the Provider or Get_it, correct?
Not with Get. You just need to ask Get to "find" for your controller, you don't need any additional
dependencies:
Learn more Ok, Got it
https://pub.dev/packages/get 10/34
16/05/23, 15.37 get | Flutter Package
And then you will be able to recover your controller data that was obtained back there:
Text(controller.textFromApi);
Utils
Internationalization
Translations
Translations are kept as a simple key-value dictionary map. To add custom translations, create a
class and extend Translations .
import 'package:get/get.dart';
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
Using translations
https://pub.dev/packages/get 11/34
16/05/23, 15.37 get | Flutter Package
Just append .tr to the specified key and it will be translated, using the current value of
Get.locale and Get.fallbackLocale .
Text('title'.tr);
import 'package:get/get.dart';
Text('logged_in'.trParams({
'name': 'Jhon',
'email': 'jhon@example.com'
}));
Locales
Pass parameters to GetMaterialApp to define the locale and translations.
return GetMaterialApp(
translations: Messages(), // your translations
locale: Locale('en', 'US'), // translations will be displayed in that locale
fallbackLocale: Locale('en', 'UK'), // specify the fallback locale in case an
This);
site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 12/34
16/05/23, 15.37 get | Flutter Package
Change locale
Call Get.updateLocale(locale) to update the locale. Translations then automatically use the new
locale.
System locale
To read the system locale, you could use Get.deviceLocale .
return GetMaterialApp(
locale: Get.deviceLocale,
);
Change Theme
Please do not use any higher level widget than GetMaterialApp in order to update it. This can
trigger duplicate keys. A lot of people are used to the prehistoric approach of creating a
"ThemeProvider" widget just to change the theme of your app, and this is definitely NOT necessary
with GetX™.
You can create your custom theme and simply add it within Get.changeTheme without any
boilerplate for that:
Get.changeTheme(ThemeData.light());
If you want to create something like a button that changes the Theme in onTap , you can combine
two GetX™ APIs for that:
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
Get.changeTheme(Get.isDarkMode? ThemeData.light(): ThemeData.dark());
https://pub.dev/packages/get 13/34
16/05/23, 15.37 get | Flutter Package
When .darkmode is activated, it will switch to the light theme, and when the light theme becomes
active, it will change to dark theme.
GetConnect
GetConnect is an easy way to communicate from your back to your front with http or websockets
Default configuration
You can simply extend GetConnect and use the GET/POST/PUT/DELETE/SOCKET methods to
communicate with your Rest API or websockets.
GetSocket userMessages() {
return socket('https://yourapi/users/socket');
}
}
Custom configuration
GetConnect is highly customizable You can define base Url, as answer modifiers, as Requests
modifiers, define an authenticator, and even the number of attempts in which it will try to
authenticate itself, in addition to giving the possibility to define a standard decoder that will
transform all your requests into your Models without any additional configuration.
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 14/34
16/05/23, 15.37 get | Flutter Package
httpClient.addAuthenticator((request) async {
final response = await get("http://yourapi/token");
final token = response.body['token'];
// Set the header
request.headers['Authorization'] = "$token";
return request;
});
//Autenticator will be called 3 times if HttpStatus is
//HttpStatus.unauthorized
httpClient.maxAuthRetries = 3;
}
}
@override
Future<Response<CasesModel>> getCases(String path) => get(path);
}
GetPage Middleware
The GetPage has now new property that takes a list of GetMiddleWare and run them in the specific
order.
This site uses cookies from Google to deliver and enhance the quality of its services and to
Note: When
analyze GetPage has a Middlewares, all the children of this page will have the same
traffic.
middlewares automatically.
Learn more Ok, Got it
Priority
https://pub.dev/packages/get 15/34
16/05/23, 15.37 get | Flutter Package
The Order of the Middlewares to run can be set by the priority in the GetMiddleware.
final middlewares = [
GetMiddleware(priority: 2),
GetMiddleware(priority: 5),
GetMiddleware(priority: 4),
GetMiddleware(priority: -8),
];
Redirect
This function will be called when the page of the called route is being searched for. It takes
RouteSettings as a result to redirect to. Or give it null and there will be no redirecting.
onPageCalled
This function will be called when this Page is called before anything created you can use it to
change something about the page or give it new page
OnBindingsStart
This function will be called right before the Bindings are initialize. Here you can change Bindings
for this page.
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 16/34
16/05/23, 15.37 get | Flutter Package
OnPageBuildStart
This function will be called right after the Bindings are initialize. Here you can do something after
that you created the bindings and before creating the page widget.
OnPageBuilt
This function will be called right after the GetPage.page function is called and will give you the
result of the function. and take the widget that will be showed.
OnPageDispose
This function will be called right after disposing all the related objects (Controllers, views, ...) of the
page.
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 17/34
16/05/23, 15.37 get | Flutter Package
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 18/34
16/05/23, 15.37 get | Flutter Package
// Equivalent to : MediaQuery.of(context).size.height,
// but immutable.
Get.height
ThisGet.width
site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.the current context of the Navigator.
// Gives
Get.context
// Gives theLearn more
context Ok,
of the snackbar/dialog/bottomsheet in Got
the it
foreground, anywhere
Get.contextOverlay
https://pub.dev/packages/get 19/34
16/05/23, 15.37 get | Flutter Package
https://pub.dev/packages/get 20/34
16/05/23, 15.37 get | Flutter Package
/// Returns a value<T> according to the screen size
/// can give value for:
/// watch: if the shortestSide is smaller than 300
GetMaterialApp(
///enableLog:
mobile: iftrue,
the shortestSide is smaller than 600
///logWriterCallback:
tablet: if the shortestSide is smaller than 1200
localLogWriter,
/// desktop: if width is largest than 1200
);
context.responsiveValue<T>()
void localLogWriter(String text, {bool isError = false}) {
// pass the message to your favourite logging package here
// please note that even if enableLog: false log messages will be pushed in this
// you get check the flag if you want through GetConfig.isLogEnable
}
ValueBuilder
A simplification of StatefulWidget that works with a .setState callback that takes the updated
value.
ValueBuilder<bool>(
initialValue: false,
builder: (value, updateFn) => Switch(
value: value,
onChanged: updateFn, // same signature! you could use ( newValue ) => updateFn
),
// if you need to call something outside the builder method.
onUpdate: (value) => print("Value updated: $value"),
onDispose: () => print("Widget unmounted"),
),
ObxValue
Similar ValueBuilder
This sitetouses , butGoogle
cookies from this is to
thedeliver
Reactive
andversion,
enhance youthe
pass a Rxof
quality instance (remember
its services and to the
magical .obs?) and updates automatically... isn't it awesome?
analyze traffic.
https://pub.dev/packages/get 21/34
16/05/23, 15.37 get | Flutter Package
Useful tips
.obs ervables (also known as Rx Types) have a wide variety of internal methods and operators.
Is very common to believe that a property with .obs IS the actual value... but
make no mistake! We avoid the Type declaration of the variable, because Dart's
compiler is smart enough, and the code looks cleaner, but:
Even if message prints the actual String value, the Type is RxString!
So, you can't do message.substring( 0, 4 ) . You have to access the real value inside the
observable: The most "used way" is .value , but, did you know that you can also use...
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 22/34
16/05/23, 15.37 get | Flutter Package
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 23/34
16/05/23, 15.37 get | Flutter Package
// You can use all non mutable operations from num primitives!
count + 1;
// Watch out! this is only valid if `count` is not final, but var
count += 1;
/// booleans:
final flag = false.obs;
// RxMap, RxList and RxSet are special Rx types, that extends their native types.
// but you can work with a List as a regular list, although is reactive!
abc.add(12); // pushes 12 to the list, and UPDATES the stream.
abc[3]; // like Lists, reads the index 3.
// equality works with the Rx and the value, but hashCode is always taken from the
final number = 12.obs;
Thisprint(
site uses cookies
number == from Google
12 ); to deliver
// prints and enhance the quality of its services and to
> true
analyze
/// traffic.
Custom Rx Models:
// toJson(), toString() are deferred to the child, so you can implement override o
Learn more Ok, Got it
class User {
https://pub.dev/packages/get 24/34
16/05/23, 15.37 get | Flutter Package
@override
StateMixin
}
String toString() => '$name $last, $age years old';
print( user );
change(data, status: RxStatus.success());
RxStatus.loading();
RxStatus.success();
RxStatus.empty();
RxStatus.error('message');
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 25/34
16/05/23, 15.37 get | Flutter Package
body: controller.obx(
(state)=>Text(state.name),
// here also you can set your own error widget, but by
// default will be an Center(child:Text(error))
onError: (error)=>Text(error),
),
);
}
GetView
I love this Widget, is so simple, yet, so useful!
Is a const Stateless Widget that has a getter controller for a registered Controller , that's
all.
// ALWAYS remember to pass the `Type` you used to register your controller!
class AwesomeView extends GetView<AwesomeController> {
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(20),
child: Text(controller.title), // just call `controller.something`
);
}
}
GetResponsiveView
This site uses cookies from Google to deliver and enhance the quality of its services and to
Extend
analyzethis widget to build responsive view. this widget contains the screen property that have all
traffic.
information about the screen size and type.
With settings property you can set the width limit for the screen types.
GetWidget
Most people have no idea about this Widget, or totally confuse the usage of it. The use case is very
rare, but very specific: It caches a Controller. Because of the cache, can't be a const Stateless .
That's where GetWidget shines... as you can use it, for example, to keep a list of Todo items. So, if
the widget gets "rebuilt", it will keep the same controller instance.
GetxService
This class is like a GetxController , it shares the same lifecycle ( onInit() , onReady() ,
onClose() ). But has no "logic" inside of it. It just notifies GetX Dependency Injection system, that
this subclass can not be removed from memory.
So is super useful to keep your "Services" always reachable and active with Get.find() . Like:
ApiService , StorageService , CacheService .
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 27/34
16/05/23, 15.37 get | Flutter Package
/// Is a smart move to make your Services intiialize before you run the Flutter ap
/// as you can control the execution flow (maybe you need to load some Theme config
/// apiKey, language defined by the User... so load SettingService before running A
/// so GetMaterialApp() doesnt have to rebuild, and takes the values directly.
void initServices() async {
print('starting services ...');
/// Here is where you put get_storage, hive, shared_pref initialization.
/// or moor connection, or whatever that's async.
await Get.putAsync(() => DbService().init());
await Get.putAsync(SettingsService()).init();
print('All services started...');
}
The only way to actually delete a GetxService , is with Get.reset() which is like a "Hot Reboot"
of your app. So remember, if you need absolute persistence of a class instance during the lifetime
of your app, use GetxService .
Tests
You can test your controllers like any other class, including their lifecycles:
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 28/34
16/05/23, 15.37 get | Flutter Package
@override
void onClose() {
name.value = '';
super.onClose();
}
final name = 'name1'.obs;
void main() {
test('''
Test the state of the reactive variable "name" across all of its lifecycles''',
() {
/// You can test the controller without the lifecycle,
/// but it's not recommended unless you're not using
/// GetX dependency injection
final controller = Controller();
expect(controller.name.value, 'name1');
expect(controller.name.value, '');
});
}
Tips
This site uses cookies from Google to deliver and enhance the quality of its services and to
Mockito or mocktail
analyze traffic.
If you need to mock your GetxController/GetxService, you should extend GetxController, and mixin
it with Mock, that Learn
way more Ok, Got it
https://pub.dev/packages/get 29/34
16/05/23, 15.37 get | Flutter Package
Using Get.reset()
If you are testing widgets, or test groups, use Get.reset at the end of your test or in tearDown to
reset all settings from your previous test.
Get.testMode
if you are using your navigation in your controllers, use Get.testMode = true at the beginning of
your main.
Before After
StringX RxString
IntX RxInt
MapX RxMap
ListX RxList
NumX RxNum
DoubleX RxDouble
RxController and GetBuilder now have merged, you no longer need to memorize which controller
you want to use, just use GetxController, it will work for simple state management and for reactive
as well.
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
2- NamedRoutes Before:
https://pub.dev/packages/get 30/34
16/05/23, 15.37 get | Flutter Package
GetMaterialApp(
namedRoutes: {
'/': GetRoute(page: Home()),
}
)
Now:
GetMaterialApp(
getPages: [
GetPage(name: '/', page: () => Home()),
]
)
Why this change? Often, it may be necessary to decide which page will be displayed from a
parameter, or a login token, the previous approach was inflexible, as it did not allow this. Inserting
the page into a function has significantly reduced the RAM consumption, since the routes will not
be allocated in memory since the app was started, and it also allowed to do this type of approach:
GetMaterialApp(
getPages: [
GetPage(name: '/', page:(){
return box.hasData('token') ? Home() : Login();
})
]
)
Why Getx?
1- Many times after a Flutter update, many of your packages will break. Sometimes compilation
errors happen, errors often appear that there are still no answers about, and the developer needs to
know where the error came from, track the error, only then try to open an issue in the
corresponding repository,
This site uses cookies fromand see itstoproblem
Google solved.
deliver and Get centralizes
enhance the qualitythe
of main resources
its services andfor
to
development (State, dependency and route management), allowing you to add a single package to
analyze traffic.
your pubspec, and start working. After a Flutter update, the only thing you need to do is update the
Get dependency, and get to work. Get also resolves compatibility issues. How many times a
Learn more Ok, Got it
version of a package is not compatible with the version of another, because one uses a
https://pub.dev/packages/get 31/34
16/05/23, 15.37 get | Flutter Package
dependency in one version, and the other in another version? This is also not a concern using Get,
as everything is in the same package and is fully compatible.
2- Flutter is easy, Flutter is incredible, but Flutter still has some boilerplate that may be unwanted
for most developers, such as Navigator.of(context).push (context, builder [...] . Get
simplifies development. Instead of writing 8 lines of code to just call a route, you can just do it:
Get.to(Home()) and you're done, you'll go to the next page. Dynamic web urls are a really painful
thing to do with Flutter currently, and that with GetX is stupidly simple. Managing states in Flutter,
and managing dependencies is also something that generates a lot of discussion, as there are
hundreds of patterns in the pub. But there is nothing as easy as adding a ".obs" at the end of your
variable, and place your widget inside an Obx, and that's it, all updates to that variable will be
automatically updated on the screen.
3- Ease without worrying about performance. Flutter's performance is already amazing, but
imagine that you use a state manager, and a locator to distribute your blocs/stores/controllers/
etc. classes. You will have to manually call the exclusion of that dependency when you don't need
it. But have you ever thought of simply using your controller, and when it was no longer being used
by anyone, it would simply be deleted from memory? That's what GetX does. With
SmartManagement, everything that is not being used is deleted from memory, and you shouldn't
have to worry about anything but programming. You will be assured that you are consuming the
minimum necessary resources, without even having created a logic for this.
4- Actual decoupling. You may have heard the concept "separate the view from the business logic".
This is not a peculiarity of BLoC, MVC, MVVM, and any other standard on the market has this
concept. However, this concept can often be mitigated in Flutter due to the use of context. If you
need context to find an InheritedWidget, you need it in the view, or pass the context by parameter. I
particularly find this solution very ugly, and to work in teams we will always have a dependence on
View's business logic. Getx is unorthodox with the standard approach, and while it does not
completely ban the use of StatefulWidgets, InitState, etc., it always has a similar approach that can
be cleaner. Controllers have life cycles, and when you need to make an APIREST request for
example, you don't depend on anything in the view. You can use onInit to initiate the http call, and
when the data arrives, the variables will be populated. As GetX is fully reactive (really, and works
under streams), once the items are filled, all widgets that use that variable will be automatically
updated in the view. This allows people with UI expertise to work only with widgets, and not have to
send anything to business logic other than user events (like clicking a button), while people
working with business logic will be free to create and test the business logic separately.
This library will always be updated and implementing new features. Feel free to offer PRs and
This site uses
contribute cookies from Google to deliver and enhance the quality of its services and to
to them.
analyze traffic.
Community
Learn more Ok, Got it
https://pub.dev/packages/get 32/34
16/05/23, 15.37 get | Flutter Package
Community channels
GetX has a highly active and helpful community. If you have questions, or would like any
assistance regarding the use of this framework, please join our community channels, your question
will be answered more quickly, and it will be the most suitable place. This repository is exclusive
for opening issues, and requesting resources, but feel free to be part of GetX Community.
How to contribute
Want to contribute to the project? We will be proud to highlight you as one of our collaborators.
Here are some points where you can contribute and make Get (and Flutter) even better.
https://pub.dev/packages/get 33/34
16/05/23, 15.37 get | Flutter Package
GetX, the all-in-one Flutter package - A brief tutorial covering State Management and
Navigation by Thad Carnevalli.
Build a To-do List App from scratch using Flutter and GetX - UI + State Management + Storage
video by Thad Carnevalli.
GetX Flutter Firebase Auth Example - Article by Jeff McMorris.
Flutter State Management with GetX – Complete App - by App With Flutter.
Flutter Routing with Animation using Get Package - by App With Flutter.
A minimal example on dartpad - by Roi Peker
This site uses cookies from Google to deliver and enhance the quality of its services and to
analyze traffic.
https://pub.dev/packages/get 34/34