Questions tagged [statefulwidget]
339 questions
-1
votes
1 answer
Is there a way to set a periodic timer for a Flutter StatefulBuilder to update with setState() every 1 second?
I found this help on StatefulBuilder and it shows how to use setState to update things in a ModalBottomSheet. But I want to go one more step and make a timer to do this.
https://stackoverflow.com/a/56972160/559525
I create the timer like this…

Eradicatore
- 1,501
- 2
- 20
- 38
-1
votes
2 answers
Initstate isn't referenced Flutter Problem
i am facing a new problem with my code, and honestly, I cant figure out where is my mistake , i have made the exact same widget in another file, and runs perfectly.
I'm starting to believe that there is one problem with some widgets maybe.
I paste…

Santiago Evan
- 1
- 3
-1
votes
1 answer
Flutter setState({}) is updating the Widget State even after a delay when the variable is changed
The thing I am doing is calling setState() method and then updating the state after a delay of 5 seconds. Even then, i am seeing the State getting updated.
setState(() {
print("callback");
});
sleep(const Duration(seconds: 5));
_randomNumber =…

Sasank Sunkavalli
- 3,864
- 5
- 31
- 55
-1
votes
1 answer
Call a setState of a statefull widget from the stateless widget
I have a stateless widget class that has a widget whose movements need to be tracked. I cannot keep this widget inside the stateful widgets as I don't want the state of this widget to be refreshed.
I have the following code.
import…

MOHAMMED NUMAN
- 183
- 12
-1
votes
2 answers
Flutter: Updating UI from outside of a StatefulWidget
I am new to flutter, and working on a shopping cart project. i don't know how exatly i am suppose to ask this question but, here is what i wanted.
I am trying to update my UI when the cart item and prices changes, which means to display sum amount…

iamnabink
- 454
- 9
- 27
-2
votes
1 answer
Confusion between two different stateful widgets
So I am developing this app, where this code represents one screen of it. Basically it has a graph and displays some information related to it. What I am doing is that in the tab bar, based on the tab I have selected, I am updating the height of the…

Anurag Hale
- 133
- 9
-2
votes
1 answer
Passing data to a State from his Statefulwidget
this is my code and i want to access to "initialValue" propierty from the StatefulWudget but for some reason marks a error in counter = widget.initialValue
the image with the error from vs code.
I'm following a course and i don't know if something…

hpinzon15
- 11
- 2
-2
votes
1 answer
In Flutter while building your app how do we decide when to use a StatelessWidget or StatefulWidget?
The core concept of StatelessWidget and StatefulWidget is confusing to me.

SoloRockstar
- 31
- 5
-6
votes
2 answers
How can I make a stateless widget into a stateful one?
I have to make a stateless widget into a stateful one, based on a changing string parameter. I tried to get the string from the actual widget, but I ran into an error
It is a colored indicator which changes its color after the status string, but I…