Questions tagged [statefulwidget]

339 questions
0
votes
0 answers

Is there a way to push the updated state of data of one stateful widget into another stateful widget?

I have been struggling with the problem of pushing updated data from one widget to another. This problem occurs when I have two Stateful widgets and the data is updated in the parent Stateful widget but is not updated in the child Stateful widget.…
dotmp3
  • 494
  • 4
  • 13
0
votes
0 answers

Get variable data from a Stateful widget in another Stateful widget.. Flutter

Get variable data from a Stateful widget in another Stateful widget and they have no relation to one another (They are not children nor parents to each other) I want to be able to access an array (posts) that is located in another file... You can…
Hussein Al-Mosawi
  • 1,464
  • 3
  • 17
  • 37
0
votes
1 answer

Flutter reuse state from StatefulWidget on rebuild

In short, the question is: How do I reuse the state of an entire widget subtree? This is what my code currently looks like: ... BlocBuilder( builder: (context, state) { if (state is Authenticating) { return…
Lucas Aschenbach
  • 862
  • 1
  • 11
  • 17
0
votes
2 answers

How can I make the switches, which have their own StatelessWidget Class toggle when clicked?

I am trying to make two switches toggle between on and off when they are clicked. I created a StatelessWidget class for the design of the switches. However, when I use this, and call the class in my User interface class, the switches do not change…
helloworld12345
  • 176
  • 1
  • 4
  • 22
0
votes
1 answer

How can I rebuild a page after setting its state with Providers?

I'm new to Providers and I was enjoying how relatively fast and simple it was. However, I've encountered an issue with the app I'm currently building. It's a simple app that fetches items, the user and his/her cart. Displaying the user's info, cart…
Tim Mwaura
  • 577
  • 1
  • 7
  • 24
0
votes
1 answer

How to store the value received through a method in another variable instance?

How to store the value received through a method in another variable instance? I want to store the value passed to the Statefulwidget in an instance which I am not able to do. This is how I pass the value to the Statefulwidget's…
user13410550
0
votes
1 answer

Stateless Widget for Checkbox and TextField

When i use Checkbox in StatelessWidget, I can't change checkbox to checked/unchecked at runtime but it's work if i use StatefulWidget. But, why i can change (typing) TextField value when I use StatelessWidget?
Iswanto San
  • 18,263
  • 13
  • 58
  • 79
0
votes
1 answer

Flutter Initializing Variable before building the Widget

i'am trying to get a "Water Meter" going. When i'am opening the App the Value for this should be generated. My problem here is that when i am building the Widget it doesn't Render the actual value. Only if i go to another Screen or Hot Reload the…
Subby
  • 1
  • 2
0
votes
0 answers

Flutter listview builder with statefull widgets does not update with set state in the parent widget

The listviewbuilder I created with stateful widgets only updates when I scroll it.When I used stateless widgets it reloads perfectly, but it doesn't work with stateful, I have a RefreshIndicator which calls the data getting method, I don't know…
0
votes
2 answers

Value property doesn't update for dropdownfield when I do setState in flutter

I am updating the dropdown table dynamically from an API. When I select an hour, the corresponding subjects are retrieved from the API. Let's say I am switching between hours. Hour 5 has the subjects A and B while hour 4 has the subject B…
0
votes
2 answers

Copy a value to another StatefulWidget

I tried to rebuild the code of this video (https://www.youtube.com/watch?v=d5PpeNb-dOY) , which is about how to copy a String value to another StatefulWidget, but now I get the BodyConstructionState(value) red underlined and it says "Too many…
simi
  • 323
  • 4
  • 12
0
votes
1 answer

how to pass data from StatelessWidget to StatefulWidget

Please , i want to pass data ( index and list from ItemList to FloatingActionButton in StatefulWidget) class _mes_adresseState extends State { DatabaseHelper databaseHelper = new DatabaseHelper(); _save(String token) async { …
0
votes
1 answer

Start a function from another Widget

Hey guys I have a (hopefully for you simple) problem. How can I start a function from another Widget? I have a statelessWidget from where I want to start a timer function, which is in a statefulWidget. How can I start the timer (which "is" in the…
simi
  • 323
  • 4
  • 12
0
votes
1 answer

How to prevent Stateful Widget stored in List to be disposed?

Let me start by explaining the problem. I have several buttons which are created based on data I'm getting from a server. On each button click I need to create and display a widget which will present me some data (this widget is also built…
0
votes
1 answer

How to use two global keys for two widgets sharing the same state class

I am trying to create my own custom segment in flutter. That segment has two buttons, one for teachers and other for students. What I am trying to do, it's encapsulate the buttons in one Stateful Widget to handle the setState of both buttons,…