GetX is a state management, dependency injection, and route management solution for Flutter.
Questions tagged [flutter-getx]
1530 questions
26
votes
6 answers
Flutter Getx: initial value of obs variable set to null
Upon now I always use getx observable declarations like this:
var someString = ''.obs;
var someNumber = 0.obs;
and so on...
But what if some variables don't have an initial value at first, and I actually want them to be null and later change them?

BigPP
- 522
- 2
- 8
- 18
26
votes
4 answers
flutter passing multiple data with getx
I want to Pass multiple data from one screen to another screen with Get package.
Get.to(Second(), arguments: ["First data", "Second data"]);

Jewel Rana
- 2,397
- 1
- 19
- 28
21
votes
6 answers
Flutter Getx - "Xxx" not found. You need to call "Get.put(Xxx())" - But i have called Get.put(Xxx())
I have this global bindings class to initialise some services and I need it to be initialised straight away:
import 'package:get/get.dart';
import 'package:vepo/data/data_provider/local_data_provider.dart';
import…

BeniaminoBaggins
- 11,202
- 41
- 152
- 287
17
votes
2 answers
Flutter GetX forms validation
I am looking for an example of how to handle forms and validation in best practice with GetX?
Is there any good example of that or can someone show me an example of how we best can do this?

allmighty
- 205
- 1
- 2
- 6
16
votes
6 answers
Get.to(MyPage()) - How to remove all previous routes - Flutter GetX
I have a simple Flutter app and I want to remove all previous routes but I want to do with GetX, How to do that?
Now it works with
Navigator.of(context).pushNamedAndRemoveUntil('/home', (Route route) => false);
But I want to know the…

Álvaro Agüero
- 4,494
- 1
- 42
- 39
15
votes
5 answers
Flutter GetX Get.back() or navigator.pop() deletes controller from memory and can not recreate it
I have two pages: HomePage and DetailsPage and associated GetxControllers.
HomePage:
class HomePage extends GetView {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title:…

S. M. JAHANGIR
- 4,324
- 1
- 10
- 30
14
votes
2 answers
Unit Testing GetxController
I'm a beginner with tdd so please forgive me if it's a dumb question.
I'm having difficulty unit testing GetxControllers. Does anyone know a simple way of doing this?
Whenever I do I get errors since Get is calling onStart and it doesn't like the…

Ovidius Mazuru
- 750
- 7
- 14
14
votes
8 answers
Flutter - getx controller not updated when data changed
I am developing an app that has a bottomnavitaionbar with five pages. I use getx. In first page, i am listing data. My problem is that, when i changed data(first page in bottomnavigationbar) manually from database and thn i pass over pages, came…

jancooth
- 555
- 1
- 10
- 25
14
votes
4 answers
How to Refresh the UI in ListView.Builder using flutter GetX when data is changed?
I'm refactoring my app to GetX state management for less boilerplate code.
I make the Controller and the API provider (code below).
But when I want to refresh the data (Manually too) it won't change.
home_page.dart
class HomeUI extends…

J.Maher
- 312
- 1
- 4
- 14
11
votes
4 answers
Diff between get.put and get.lazyput
I am new to Getx's dependency injection, so can some one explain to me the benefits of Get.put() and Get.lazyPut() and tell me also what difference they have?

saif rehman
- 143
- 1
- 1
- 7
11
votes
7 answers
GetX Controller not disposing off automatically
I have a minimlaist sample app running on Android with GetX as State Management lib only. There are two screens LandingPage and MainScreen. On going back from MainScreen to LandingPage screen, the controller is not autodisposing as expected.
I am…

Akash Gorai
- 580
- 1
- 8
- 17
11
votes
2 answers
Flutter: Refreshing ListView.Builder with GetX
I am creating the List of Cards according to the number of toDoId.
toDoController.toDo() is like
toDo = [q1, r4, g4, d4].obs;
And, this is my ListView.builder()
Obx(() {
List _todo = toDoController.toDo();
return…

chichi
- 2,777
- 6
- 28
- 53
9
votes
2 answers
Is it possible to access GetxController value from another GetxController? Flutter Get Package
I'm new in Flutter and so with GetX https://pub.dev/packages/get
Am I able to access value from "another controller" inside a controller?
Both of them will be initialized but I don't want to pass "id" at screens/widget/handlers etc., I want to do it…

Koala
- 352
- 2
- 7
- 18
9
votes
7 answers
Getx Flutter - Updating item in list is not reactive
I am using getx as my statemanagment for my flutter app. But I am having difficulties by updating the values in a list. So I have a usermodel with a parameter of isFollowing. When I click on a button the isFollowing variable shall change and the…

Coding Hotel
- 127
- 1
- 1
- 7
9
votes
3 answers
Getx is not working properly with FutureBuilder for update list
I'm using the Getx controller in my project. I have create the controller for FutureBuilder for displaying list but .Obs is not set on Future Function. I'm sharing the code.
class PPHomeController extends GetxController {
…

Alpit Panchal
- 709
- 1
- 7
- 25