Questions tagged [flutter-getx]

GetX is a state management, dependency injection, and route management solution for Flutter.

1530 questions
8
votes
4 answers

Flutter getx controller get the current page context

I would like to use context to show a custom dialog from cool alert in getxcontroller method. I have created the following controller class HomePageController extends GetxController { @override void onInit() { super.onInit(); …
Geoff
  • 6,277
  • 23
  • 87
  • 197
8
votes
2 answers

How to check if a controller has put with Flutter GetX?

I have the following code: Get.put(DbController(HabitDao(AppDb()))); When I hot reload my app, I get the following error: "WARNING (moor): It looks like you've created the database class AppDb multiple times. When these two databases use the same…
M. Azyoksul
  • 1,580
  • 2
  • 16
  • 43
8
votes
3 answers

Flutter DropdownButton widget with Getx

I'm in the process of learning GetX state management and stumble upon the DropdownButton widget. How do I update the selected value with the selected value cannot be observed. Here is my DropdownButton widget DropdownButton( …
Hanis
  • 309
  • 1
  • 6
  • 15
8
votes
5 answers

error [Get] the improper use of a GetX has been detected. using bottomNavigationBar

I'm trying to implement a bottomNavigationBar, but I can't finish it, I'm using Get to handle the routes and the state of the application. I'm new to flutter, but reading the documentation I still don't understand This is the main widget. Widget…
SirRiT003
  • 173
  • 1
  • 2
  • 6
8
votes
5 answers

Flutter Getx Snackbar not wroking

I have created a flutter app and used getx package. But then I used it to show the snack bar, the function gets executed but the snack bar is not showing up. onPressed: () { print("executed"); Get.snackbar( "title", …
Abhijith Konnayil
  • 4,067
  • 6
  • 23
  • 49
7
votes
2 answers

How to use multiple getx controllers in Flutter?

I wonder how to use multiple getx controllers in flutter. Even if the data is updated, it is not reflected in real time. and Getbuilder can only use one controller. Can you give me an example of the code? Code example class Controller1 extends…
Damian
  • 109
  • 1
  • 1
  • 7
7
votes
3 answers

Flutter: type 'bool' is not a subtype of type 'RxBool' in type cast

I'm Using GetX Package for State Management in Flutter. I'm trying to show data based on whether condition is true or not. But gets this error which says `type 'bool' is not a subtype of type 'RxBool' in type cast'. Below is my code which I'm trying…
Jay Tillu
  • 1,348
  • 5
  • 23
  • 40
7
votes
2 answers

Flutter and Getx: How to Pass parameters from UI to Getx controller?

I have this Getx controller for reading content of a Post from database: class ReadSinglePostController extends GetxController { var isLoading = true.obs; var posts = Post( postID: 1, userID: 0, thumbnail:…
BigPP
  • 522
  • 2
  • 8
  • 18
7
votes
2 answers

How to present page with different transition (push / modal) in Flutter with Getx?

I have a page that can present in two ways, modally and push, based on where this page gets initiated. I use toNamed to present those pages, but the problem is I can't pass fullscreenDialog flag at the call site. I expected something like…
sarunw
  • 8,036
  • 11
  • 48
  • 84
7
votes
8 answers

Flutter GETX: How to remove Initialized Controller every time we navigate to other page/routes

newbie here. How do I re-run onInit() every time I push back to my screen? onInit() runs only once but navigating back to a previous screen does not delete the controller which was initialized (FetchData) hmmm.. I'm only using Get.back() every time…
Koala
  • 352
  • 2
  • 7
  • 18
7
votes
2 answers

How to retrieve a TextEditingController inside a Controller layer with Getx?

I have this statement in my View layer TextEditingController controllerDestino = TextEditingController(); And I want to recover this controllerDestino, to use within a method that is in my Controller layer. statusUberNaoChamado() { showBoxAdress =…
Lucas Baggio
  • 378
  • 1
  • 4
  • 12
7
votes
1 answer

GetX - How to return a value from Get.Dialog?

How can I get a return value from a Get.Dialog that opens a Dialog Widget / AlertDialog?
Baker
  • 24,730
  • 11
  • 100
  • 106
7
votes
6 answers

Flutter: How to listen to variable change on GetX

I want to change body of the widget depending on if the pressedBool is false or true. Here is GetxController I wrote. import 'package:get/state_manager.dart'; class PressedState extends GetxController{ var pressedBool = true; …
Umut Arpat
  • 454
  • 1
  • 6
  • 18
6
votes
3 answers

How to select only one group value of Radio button in Flutter?

I'm using Flutter-Dart-SQLite to develop a quiz application. Here I have used RadioListTile for radio button functionality. I am passing the text value from an array to this StatefulWidget. This is the code I'm using, import…
Terin Tittu
  • 143
  • 1
  • 1
  • 15
6
votes
2 answers

The member 'value' can only be used within instance members of subclasses of 'package:get/get_rx/src/rx_types/rx_iterables/rx_list.dart'

I'm using GetX for my project. I have a little warning with RxList in GetX. How do I fix this warning? This is my code: var questionListItems = RxList(); // .... Future onInit() async { if…
Huu Bao Nguyen
  • 1,051
  • 2
  • 14
  • 40