Questions tagged [flutter-state]
369 questions
0
votes
0 answers
Flutter method reuses old list value
I just refactored a method slightly by removing some of the widget as another stateless widget named TransformableSSLVI (transformable saved searches list view item)
I return the extracted TransformableSSLVI widget from a method…

L1ghtsp33D
- 109
- 1
- 5
0
votes
0 answers
Flutter Firebase Authentication With Riverpod
By reading the documentation of riverpod I wanted to redo the example of the section "third party examples" the example is "firebase phone auth with riverpod" here is the link:https://docs-v2.riverpod.dev/docs/getting_started ; and the github…
0
votes
2 answers
my question is not updating even after changing the index to that question
what i want in this code is that the questions to change to the next one in the map whenever the user presses any of the true of false buttons, but the question is not updating even after changing the index and using setstate. I don't know what is…

Ahmad Maaz
- 45
- 6
0
votes
2 answers
Can't use a setState call in the onchanged callback in flutter
I am trying to map a TextFormFields value to a state variable in flutter
class _PageState extends State {
String _tag = ''; // this is the state variable
@override
Widget build(BuildContext context) {
final _formKey =…

Shobi
- 10,374
- 6
- 46
- 82
0
votes
0 answers
Update the page using FutureBuilder() + GetBuilder()
Is there a way to update the state when I use both Getbuilder() + FutureBuilder()
I have list of users in firebase document,
I display these users using Futurebuilder
I want when i click on any user, that user get deleted
I managed to delete the…

BlaCK _ WolF
- 17
- 5
0
votes
1 answer
Why is my SimpleMap widget not accessing my _countrycode variable?
I'm trying to use the country code variable that I declared and stat updated into my Text Field but somehow when I try using it in my Simple map Widget it says that the named parameter isn't defined. Can someone explaine me what I'm doing wrong…

Coca95
- 31
- 5
0
votes
0 answers
How to use Multiple providers nested inside three custom classes?
I'm seeking some help to overcome some difficulties to understand how to properly use provider as state management. I have three custom classes StationModel, SlideModel and ProductModel nested inside each other, like a Russian doll. All of them…
0
votes
1 answer
When to use Consumer & when to use context.watch to access the provider values?
Recently I discovered that we can access the provider value using either
Consumer(build: (context, value, child){
return Widget(child: value.valueName),
},
)
Or using
context.watch().valueName
What is the best practice?

kartik
- 93
- 9
0
votes
2 answers
setState in showModalBottomSheet using TimePicker
I am having a problem. When I am showing my showModalBottomSheet I have a GeestureDetector on a Container, when pressed the TimePicker pops up and I can select a time. I take that value and set the state on a String that holds the new time value.…
0
votes
1 answer
How to properly modularize flutter pages
I am new to flutter so I am trying to understand how to properly make my code more modular. I have a page with buttons on it, and am trying to change the color of the buttons when they are pressed. When I have the buttons coded directly into the…

dstoner
- 49
- 1
- 5
0
votes
1 answer
File_picker in stateless bloc widget
How do you go about using file_picker package in flutter and bloc management?
https://pub.dev/packages/file_picker
I have following code:
class NewAuction extends StatelessWidget {
late final FilePickerResult? filePickerResults;
final…

muismat333
- 13
- 5
0
votes
1 answer
Flutter UI not changing after updating FutureBuilder ListView?
I have two screens, the HomePage and the Add screen. The app starts on the HomePage and has a Floating Action Button and a FutureBuilder. On clicking the FAB button, it goes to the Add screen, in which I can add details for another entry. On…

Laxman Prasad
- 3
- 2
0
votes
1 answer
Accessing state in widget and making class immutable
I need to expose a couple of functions of a Stateful Widget. Since these functions depend on the state of the widget, I created a variable to store the state.
However, I am getting a compile time warning:
This class (or a class that this class…

Tushar
- 1,242
- 1
- 8
- 19
0
votes
1 answer
Toggle switch animation not working in flutter
`I am trying to implement a toggle switch in which when I toggle the switch I display two different things but I'm getting an error while I use setstate with my logic or something like that if I remove the setstate from my code the animation starts…

Ahmad Maaz
- 45
- 6
0
votes
1 answer
Can I trigger grandparent state changes without an external state management library?
I cannot find a satisfactory way for a grandchild widget to trigger a grandparent state change. My app saves and sources its data all from an on-device database.
Ive tried to proceed this far without using a state management library as I thought…

tommytucker7182
- 213
- 1
- 5
- 11