Questions tagged [flutter-getx]

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

1530 questions
3
votes
1 answer

Is there a difference between these ways of initializing values in Flutter using GetX?

I can think of these 3 ways to initialize a value using GetX Initializing at the declaration: class StatusPane extends StatelessWidget { final HomeController homeController = Get.find(); StatusPane({Key? key}) : super(key: key); in the…
Ivo
  • 18,659
  • 2
  • 23
  • 35
3
votes
3 answers

Flutter: Undefined name 'AppLocalizations'. Try correcting the name to one that is defined, or defining the name

Flutter Default Localizations isn't work when I use GetX Statemanagement. It show me a error like Undefined name 'AppLocalizations'. Try correcting the name to one that is defined, or defining the name. How Can I fixed this ?
3
votes
1 answer

Null check operator used on a null value when use Get.offAll()

I have this AuthController that extends GetxController. I have a worker that trigger a function when the firebase user state change: _user.bindStream(auth.userChanges()); ever(_user, _initialScreen); Then in _initialScreen I have this code: …
i6x86
  • 1,557
  • 6
  • 23
  • 42
3
votes
1 answer

GetX Controller not found, you need to call Get.put or Get.lazyPut

When I navigate to my SettingsPage and refresh the page it throws the error seen in the image below. I cant seem to figure out how to solve it. The setup (so far): In the main file: Future main() async { Get.put(UserService(httpClient),…
Valentine
  • 161
  • 1
  • 12
3
votes
1 answer

Runtime Error: type 'Null' is not a subtype of type 'List'

I am very new to Dart, and coding in general. I have produced this code after watching tutorials on YouTube. For the most part, I have been able to troubleshoot most of my problems on my own, yet I cannot figure out my most recent errors. I am…
sandeep rana
  • 121
  • 11
3
votes
3 answers

How can I use condition and go to different page on flutter using Getx without click

I am trying to use firebase data to route different pages using Getx. First I have a splash screen and want to automatically go to different pages according to conditions. If the user has already login, it will redirect the Home page, if not the…
Palash Dey
  • 69
  • 1
  • 7
3
votes
1 answer

How to create Filter while using Getx

My goal is to change the data from the API after the user clicks on the filter. So filter 1 will always be on and after clicking on 2 or filter 3 only the data in filter 3 will be sorted. So instead of selecting all filters, they will only select…
regenin
  • 291
  • 9
  • 18
3
votes
2 answers

GetX Get.arguments always returns null

I have an issue with routing. I am using GetX and Get.arguments is always returning null. I am defining my routes in route_generator.dart class RouteGenerator { static Route generateRoute(RouteSettings settings) { switch…
czaku
  • 829
  • 9
  • 20
3
votes
0 answers

Persistent Navigation Menu using Flutter GetX Routes

I'd like to use the GetX routing management (getPages) but I don't want to load an entirely new scaffold/page each time the route changes - I'd just like to be able to call functions within the widget/current page itself on a route change. I've…
John Mastri
  • 83
  • 2
  • 8
3
votes
1 answer

Flutter MaterialApp conditional builder

I am using the builder function of my MaterialApp to wrap my routes with a widget. But I only want to show the wrapper on specific routes. Any idea how to achieve this? Actually I am using GetX and GetMaterialApp, but I don't think that it makes any…
Martin Seubert
  • 978
  • 3
  • 21
  • 37
3
votes
1 answer

A value of type 'String' can't be assigned to a variable of type 'RxString' in flutter Getx

I'm trying to convert image to base64 text in Getx controller but it shows error saying "A value of type 'String' can't be assigned to a variable of type 'RxString'".
3
votes
1 answer

Managing app lifecycle state with Getx in flutter?

what is the best approach to managing app lifecycle state? would you do it using a getxservice with WidgetsBindingObserver? thanks in advance.
Karan V
  • 163
  • 2
  • 10
3
votes
1 answer

Flutter, how to refresh my controller and request with getx

I am creating an app with getx. I have simple GET requests and I show the data to screen. In the detail screen, I put a button to refresh the request, response of request is coming randomly so everytime user pushes the button a different text will…
aoiTenshi
  • 547
  • 1
  • 6
  • 20
3
votes
4 answers

Getx onInit not calling

Any reason why app keep stuck on splash screen? I using getx state management. If authToken not empty, it should go to main page. But onInit in controller class not calling. void main() { runApp(const MyApp()); } class MyApp extends…
Hoo
  • 1,806
  • 7
  • 33
  • 66
3
votes
1 answer

flutter getx web sockets - stream data to be cascaded to provider and controller

Objective is simple flutter app makes a call to graphql api over websockets app view calls the controller, controller calls the provider, provider calls the AWS appsync api over websockets or over HTTP api socket call we receive a stream of data…
raaone7
  • 529
  • 1
  • 7
  • 16