Flutter Set State onPressed on RaisedButton

I am building a quiz app which reveals the explanation for the correct answer after the user submits their chosen answer. There are two buttons on the layout -...

flutter setstatus but screen didnt update

Flutter app create a Widget List (wList) and show screen properly. If user presses a button it will add a divider() to the wList and update the screen by setState(). H...

How to call a method from one statefulWidget in another Widget (Flutter)

I am trying to run method <code>doAnimation</code> from another widget by clicking on a <code>FloatingActionButton</code>. Please tell me how to do this with this simp...

setState() or markNeedsBuild() called during build.The relevant error-causing widget was MaterialApp

I'm trying to run the application but the setState error is showing at MaterialApp where I have not used setState.I tried <a href="https://stackoverflow.com/questions/...

How to correctly setState with notifyListerners() and variable value change?

I am trying to design a widget that can show or hide a card (by updating and rebuilding the current state) based on a boolean value. For this I'm using <code>IndexedSt...

How to update the drawer content only

We are using a Drawer to display the settings state. I would like the user to be able to change a setting and see the result reflected in the drawer. <...

Flutter how i can use a setState event without refresh my futurebuilder

I have a question. At the moment i try to build a category list with data from firebase. To load the data i use a futurebuilder. Here my category...

Swap Widgets on Toggle switch press in Flutter

I'm trying to implement a widget swap for a ToggleSwitch in flutter. So far I have worked around to change the swap of widgets and toggleSwitch separately. I need to c...

Flutter setState function doesnt work when used to change class member

i have the following codes, <pre class="lang-dart prettyprint-override"><code>class mWidget extends StatefulWidget { mWidget({super.key, required this.text});...

How to display dynamic numbers in model bottom sheet flutter

The problem I am facing is that my progressString is changing when downloading the file but do not update in Model Bottom Sheet. Please let me know what wrong with my...

setState not changing value in gridview in flutter

basically i m updating list value that used in gridview, when i click on gridview card, i m changing color of that card. when i print color value it did changing but i...

Flutter How I could setState when variable change?

How I could <code>setState</code> when variable change? I can't find a way to do this, and I'm a beginner in Flutter. My code: <pre><code>// i need t...

Flutter State wont update

I'm trying to create a listview of cards whose images get displayed in the listview only if the card is selected. The selection widget is the <strong>PopupSubscription...

setState() or markNeedsBuild called during build

<pre><code>class MyHome extends StatefulWidget { @override State&lt;StatefulWidget&gt; createState() =&gt; new MyHomePage2(); } class MyHomePage2 extends State&lt;My...

It does not enter in setState() method

I have the following code in Flutter. The variable checkValue is set to false and the variable newValue is optional, so I have to check if it is null or not. Then, I c...