Questions tagged [flutter-getx]

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

1530 questions
2
votes
3 answers

getx redirect middleware as a future function

I need when the user open the application, the splash screen opens. The splash screen decided if the user is gonna go to home page or sign in, using middleware in GetX layer. this function: @override RouteSettings? redirect(String? route) async{…
user16906111
2
votes
1 answer

Flutter web: get full screen size - not window size

My Flutter desktop web app has complex ui that would be too tricky to make responsive. So instead I want to put it in a FittedBox that will simply shrink the whole app if the user makes the browser window smaller. class CustomPage extends…
JakesMD
  • 1,646
  • 2
  • 15
  • 35
2
votes
1 answer

Cannot remove the last item in the ListView Flutter

I have a ListView containing the observable list var cartItems = [].obs;, when I tried to remove the last item in the ListView, I got error RangeError (index): Invalid value: Valid value range is empty: 0 and it was undone. Anyone can show…
MinhHy
  • 51
  • 4
2
votes
1 answer

How to unfocus TextFiled When id dismis the keyboard in flutter

i have textField and triger the focus by button, but when i dismis the keyboard and i try to click the button for second time the keyboard is does not showing up, because the textfield still focused onTap: () { …
adian
  • 128
  • 1
  • 14
2
votes
1 answer

Using GetX in a FutureBuilder to build a list - the UI is not updated

I'm creating a todo list (sort of) app. I have a view where I use a FutureBuilder, it calls a function to fetch the articles from the SQLite db and show as Card. I have a getx_controller.dart which contains the list as observable: class Controller…
mlazzarotto91
  • 103
  • 3
  • 13
2
votes
2 answers

Flutter GetX bindings?

Iam new to this architecture, I have a doubt regarding the bindings in getX I have two controllers cartController and splashController I need this cartController to remain its state as for the entire lifecycle of app splashController only for the…
2
votes
3 answers

How to make individual items of a list observable in getx flutter

I have a list which has numbers and as soon as they change, the UI should change too. I am using getx to make this list which is inside a GetXController. The UI uses this controller to get the list and then uses grid list to create individual…
Joel
  • 239
  • 3
  • 21
2
votes
2 answers

How to put Flutter GetXController permanently in memory?

I am using get package. Here's what my code looks like, class MyController extends GetXController{ //code to fetch data from firebase } class SecondScreen extends GetView{ @override Widget build(BuildContext context) { return…
Mayur Agarwal
  • 1,448
  • 1
  • 14
  • 30
2
votes
3 answers

Why my value is not updating in GetX Flutter

I made two very simple pages in GetX for learning it. I created three variabes for it, one is counter and other is destination and departure cities. The counter variable is updating perfectly, while the other variables are not changing their values.…
Shreyansh Sharma
  • 1,588
  • 2
  • 17
  • 42
2
votes
2 answers

How to make Flutter with GetX wait until data is loaded

I'm looking for a best-practice way to implement waiting for my app to initialize data before displaying the first page. The app has a main controller as well as a controller per page. The main controller initially loads data from a server, and…
Barsum
  • 128
  • 1
  • 2
  • 13
2
votes
0 answers

page title keeps changing between current and previous page flutter web

I'm having a weird issue changing page titles when using getx routing and navigation. Screenshot of the page title issue: im using this code to change page title : void setPageTitle(String title, BuildContext context) { …
Dev Medo
  • 21
  • 3
2
votes
1 answer

Flutter Getx builder not updating UI

I'm trying to use a GetX Builder in combination with a bool in the controller to display a loading spinner while fetching data and then the data afterwards. Printing the update to the bool shows it finishes loading and changes the variable but the…
ashleytwo
  • 191
  • 2
  • 9
2
votes
1 answer

Flutter GetX Obx "[Get] the improper use of a GetX has been detected." error on Appbar actions

I'm using Obs/Obx in 2 routes, one works fine but one doesn't. There are 2 obs vars in the controller. import 'package:get/get.dart'; class CountController extends GetxController { final vcount = 0.obs; final ncount = 0.obs; static…
Babsky
  • 23
  • 1
  • 6
2
votes
1 answer

How to pass parameter to onInit method

I want to add the parameter to GetxController's onInit method, and pass it whenever the controller init, how to achieve this code? class TestModel extends GetxController { @override void onInit(String token) { fetchApi(token); …
ccd
  • 5,788
  • 10
  • 46
  • 96
2
votes
3 answers

How to listen changes inside TextController?

I am using GetX. I need to listen changes in TextController. The follow code do not work: class Controller extends GetxController{ final txtList = TextEditingController().obs; @override void onInit() { debounce(txtList, (_) { …
Dmitry Bubnenkov
  • 9,415
  • 19
  • 85
  • 145