GetX - one of the most popular state management solution in flutter

Overview

GteX Tutorial - Udemy

GetX is one of the most popular state management solution in flutter. In addition to state management, GetX provides easy way to manage page routes.

YouTube

Video on YouTube

For JSON Viewer Pro

  1. GetX
  2. Navigation
  3. State Management
  4. GetX Controller
  5. Dependency Management
  6. Translation
  7. Themes
  8. GetXService & GetView
  9. GetWidget
  10. GetConnect
  11. GetX Pattern
  12. Utils


JSON files are hosted by jsonkeeper

Table of Contents

No. Name Contents Screenshots
1 Navigation Get.to()
Get.back()
Get.off()
Get.ofAll()
Get.toNamed()
Get.offNamed()
Get.offAllNamed()
2 Reactive State Management final name = ''.obs;
final isLogged = false.obs;
final count = 0.obs;
final balance = 0.0.obs;
final number = 0.obs;
final items = [].obs;
final myMap = {}.obs;

Obx(() =>Text('${count.value}'));

onPressed: () => increment()
3 Simple State Management class Controller extends GetxController {}
static Controller get to => Get.find();
update();

GetBuilder()
init: Controller(),
builder: (controller) => Text('${controller.counter}')
4 Reactive State Controller GetX()
init: Controller(),
builder: (controller) => Text()

In 'Controller' class:
final count = 0.obs;
   void increment() {
     count.value++;
   }

   void clearCount() {
     count.value = 0;
   }

   void onInit() { {
     super.onInit();
     ever(count, (_));
     everAll([count], (_));
     once(count, (_));
     debounce(count, (_));
     interval(count, (_))
   }
5 Simple State Controller final controller = Get.put(Controller());
GetBuilder()
id: 'count1',
builder: (controller) =>Text()

In 'Controller' class:
int count = 0;
   void increment() {
     count++;
     update();
   }

   void clearCount() {
     count = 0;
     update();
   }
6 Dependency Management Instancing methods
  Get.put()
  Get.lazyPut()
  Get.putAsync()
  Get.create()
  Get.delete()

Find controller
  final controller = Get.find< Controller>();
  Controller controller = Get.find();
Alternate controller
  Get.replace()
  Get.lazyReplace()

Binding
  void dependency(){}
  Named route > getPages > BindingBuilder() > void Function
  Named route
  initialBinding

SmartManagement
  ✰ full
  onlyBuilder
  keepFactory
7 Internationalization Custom class
  @override
  Map< String, Map< String, String>> get keys

tr > Text('key'.tr)

@key > trParams({'key':'value'})

translations
  Custom class that extends Translations

locale
  Locale()
  Get.deviceLocale()
  Get.updateLocale()

fallbackLocale
  Locale()
8 Change Theme void main() async {
  await GetStorage.init();
  runApp(const MyApp());
}

Create theme file

Config lightTheme & darkTheme

Change theme dynamically
  Get.isDarkMode > bool
  Get.changeThemeMode()
  Get.changeTheme()

Store them in local storage
  GetStorage() > read() & write()
9 GetX Service & GetView void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await initServices();
  runApp(const MyApp());
}

GetView< SettingsService>

late SharedPreferences _prefs;
final counter = 0.obs;

Life Cycle of GetX Controller

Dependency Management using GetX

Internationalization/Translations using GetX

For language code: http://lingoes.net/en/translator/langcode.htm
For language code: https://www.science.co.il/language/Codes.php

You might also like...

An all-in-one Fllutter package for state management, reactive objects, animations, effects, timed widgets etc.

An all-in-one Fllutter package for state management, reactive objects, animations, effects, timed widgets etc.

Frideos An all-in-one package for state management, streams and BLoC pattern, animations and timed widgets, effects. Contents 1. State management Gett

Dec 23, 2022

Flutter Task Manager Application Using GetX State Management

Flutter Task Manager Application Using GetX State Management

Flutter Task Manager Application Using GetX State Management flutter_getx_todo A new Flutter project. Getting Started This project is a starting point

Nov 11, 2022

FlutterQRcode - Flutter QR Code Scanner app for a specific type of QR using GetX State Management Architecture

FlutterQRcode - Flutter QR Code Scanner app for a specific type of QR using GetX State Management Architecture

qrcode A new Flutter QR Scanner Project for Data Entry using GetX state manageme

Dec 11, 2022

An example Flutter Shopping Cart UI using GetX State Management in conjunction with Firestore Database.

shopping_cart An example Flutter Shopping Cart UI using GetX State Management in conjunction with Firestore Database. 📽️ Demo Demo.Shopping.Cart.mp4

Nov 16, 2022

A new video calling mobile application using Flutter, Agora SDK and GetX state management.

A new video calling mobile application using Flutter, Agora SDK and GetX state management.

LiveBox : A Video Calling App A new video calling mobile application using Flutter, Agora SDK and GetX state management. Features Login Registration F

Dec 3, 2022

A fully functional Furniture App Clone made using Flutter, Supabase and Getx State Management.

A fully functional Furniture App Clone made using Flutter, Supabase and Getx State Management.

🛌 Flutter Furniture App 🪑 Timberr is a fully functional Furniture App Clone Developed using Flutter, Supabase and Getx State Management which is bas

Nov 22, 2022

State Persistence - Persist state across app launches. By default this library store state as a local JSON file called `data.json` in the applications data directory. Maintainer: @slightfoot

State Persistence Persist state across app launches. By default this library store state as a local JSON file called data.json in the applications dat

Sep 28, 2022

FC Times - An all in one solution for farookians

FC Times - An all in one solution for farookians

FC Times An all in one solution for farookians! Don't forget to ⭐ the repo Download Features Departmentwise timetables Exam notifications OD/Attendanc

Oct 5, 2022

Practice building basic animations in apps along with managing app state by BLoC State Management, Flutter Slider.

Practice building basic animations in apps along with managing app state by BLoC State Management including: Cubit & Animation Widget, Flutter Slider.

Jun 8, 2022
Owner
Md. Siam
Take care of yourself, you are your most valuable asset.
Md. Siam
Flutter Control is complex library to maintain App and State management. Library merges multiple functionality under one hood. This approach helps to tidily bound separated logic into complex solution.

Flutter Control is complex library to maintain App and State management. Library merges multiple functionality under one hood. This approach helps to

Roman Hornak 23 Feb 23, 2022
This repo is an example of clean architecture using the GetX state-management solution.

GetX Clean Architecture A Flutter Clean Architecture Using GetX. This repo is forked from: https://github.com/phamdinhduc795397/flutter-getx-clean-arc

Md. Siam 78 Jan 3, 2023
Flutter getx template - A Flutter Template using GetX package for State management, routing and Dependency Injection

Flutter GetX Template (GetX, Dio, MVVM) This Flutter Template using GetX package

Tareq Islam 6 Aug 27, 2022
Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.

GetWidget is a 100% free Flutter open-source UI Kit library built with Flutter SDK to make Flutter development easier and more joyful than ever. GetWi

Ionicfirebaseapp 3.7k Jan 1, 2023
Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.

GetWidget is a 100% free Flutter open-source UI Kit library built with Flutter SDK to make Flutter development easier and more joyful than ever. GetWi

Ionicfirebaseapp 3.7k Jan 3, 2023
⚡FQuery is a powerful async state management solution for flutter. It caches, updates and fully manages asynchronous data in your flutter apps.

⚡ FQuery is a powerful async state management solution for flutter. It caches, updates and fully manages asynchronous data in your flutter apps. It ca

Piyush 21 Dec 22, 2022
A flutter state management solution.

A Flutter State Management solution with dependency injection Usage Create your business logic class and place all variables, methods inside it. impor

Masum Billah Sanjid 5 Dec 15, 2022
Cubit is a lightweight state management solution

Cubit is a lightweight state management solution. It is a subset of the bloc package that does not rely on events and instead uses methods to emit new states.

Felix Angelov 582 Nov 23, 2022
A simple state management solution that combine the power of inherited widget and rxdart

Inherited RxDart is a state management library that combine the power of InheritedWidget and RxDart, a simple and elegant state management solution for apps of any scale

Nguyễn Ngọc Phước 14 Oct 26, 2022
This is just the simplyfied Flutter Plugin use for one of the popular flutter plugin for social media login.

social_media_logins Flutter Plugin to login via Social Media Accounts. Available Social Media Logins: Facebook Google Apple Getting Started To use thi

Reymark Esponilla 3 Aug 24, 2022