GetX is a state management, dependency injection, and route management solution for Flutter.
Questions tagged [flutter-getx]
1530 questions
0
votes
3 answers
Getx: what does the `.obs` function do?
Could you explain what does the .obs function do?
RxInt _questionNumber = 1.obs;

rozerro
- 5,787
- 9
- 46
- 94
0
votes
1 answer
Update a value in a getx controller before it has been rendered
I have a long list of items (objects) and each item has a getx controller.
Get.put(ItemController(itemModel), tag: itemModel.value.id.toString()) is set in the ListView.builder() when the item tile is created, but it seems that the controller only…

Simpler
- 1,317
- 2
- 16
- 31
0
votes
2 answers
Cannot navigate to different screen using FCM onMessage
I am trying to navigate to a different screen using Get when a user taps on the notification triggered from the onMessage function while the app is on foreground. So far I have not been able to do that.
Here's what I have done so far:
void…

mcfred
- 1,183
- 2
- 29
- 68
0
votes
1 answer
Flutter and GetX: How can i update my List in my View?
Im trying to display my stateList (List) and getting it updated with getX when the content of the stateList changes, but Obx only works for single widgets?.
Im currently using the spread operator (…) to display the Widgets in stateList.
How can i…

SynX
- 1
0
votes
1 answer
Flutter get.create implementation
I have a situation that only is fixed by get.create in getx package
I have the following code
class ShoppingBinding implements Bindings {
@override
void dependencies() {
Get.create(() => ShoppingController());
}
}
but…

Ardeshir ojan
- 1,914
- 1
- 13
- 36
0
votes
1 answer
The getter "some variable" isn't defined for the type 'Rx' while using getx controller
I am trying to implement reactive getx for my project to achieve cleaner code.
In the controller dart file, I have:
class ReadSinglePostController extends GetxController {
var posts = Post(
postID: 1,
userID: 0,
…

BigPP
- 522
- 2
- 8
- 18
0
votes
1 answer
is it good practice to inject other controllers dependency into another cntroller in getx flutter
for eg : there is three controllers in our Fruits App project (just random metaphore)
apple controller (which contains apple object)
mango controller (which contains mango object)
fruits controller(which contains list of fruits [apple,…

Himmat rai
- 57
- 1
- 6
0
votes
1 answer
I can't refresh the screen
I use the get package, I have a bottom navigation that is updated with Obx. There is also a search for elements, at the top level of the pages everything is updated well, but when I do push, the current page is not updated, only when you call hot…

che4len
- 63
- 1
- 7
0
votes
2 answers
Dart resetting a field at midnight everyday
I would like to reset dailyTasks field to 0 every day at midnight. I'm persisting the field using Get Storage plugin. The data is persisting but not resetting.
Code is as follow:
class DataController with GetxController {
@override
void…

Raj A
- 544
- 9
- 21
0
votes
1 answer
Flutter GetX State Management
Why can I not access the id of my object within a worker of GetX?
Here is my controller:
class SelectedSecretController extends GetxController {
Rx selectedSecret = Secret().obs;
void setSelectedSecret(secret) {
…

Martin Seubert
- 978
- 3
- 21
- 37
0
votes
1 answer
Getx not updating the UI attributes flutter
I'm trying to change the color of my container on ontap event (inside gridview builder). It was working fine when I was using setState. But as I changed it to Getx, the print statement is working fine but the color of container is not changing. here…

Hanzala Saeed
- 75
- 7
0
votes
1 answer
The argument type 'Object?' can't be assigned to the parameter type 'Map'. GetX
so basically i'm frustrated by this 'Object?' type, i already tried t change its type in core file but i was worried to cause a weird behavior in the future. heres my code any kind of help will be appreciated
class HomeViewModel extends…

Mhdi Blhoms
- 65
- 6
0
votes
1 answer
Getx argumentsbeing cleared after using showDialog() in Flutter
The used Getx Arguments are cleared after the showDialog method is executed.
_someMethod (BuildContext context) async {
print(Get.arguments['myVariable'].toString()); // Value is available at this stage
await showDialog(
…

Charith Jayasanka
- 4,033
- 31
- 42
0
votes
2 answers
Pass API Data to GetX Controller from class
How can I pass the decoded Data from my Api to my GetX Controller?
Here is my Class "Germany" and my fetchGermany() Function.
Future fetchGermany() async {
final response =
await…

Yusuf-Uluc
- 887
- 4
- 15
0
votes
0 answers
GetX: Save order of elements of fetching new data
I am using GetX. I need to display list from JSON.
class JobModelListView extends StatelessWidget {
final modelController = Get.put(JobModelList());
@override
build(BuildContext context) {
return Obx(() =>
ListView.builder(
…

Dmitry Bubnenkov
- 9,415
- 19
- 85
- 145