Questions tagged [statefulwidget]
339 questions
0
votes
1 answer
how to Access TextEditingController of multiple same Stateful Widgets in flutter?
I am making an app where a user can add multiple stateful widgets in a list view inside a home stateful widget.
Example: list of ingredients.
Every ingredient widget has a TextFormField.
A user can add as many ingredients as wish to and eventually…

Shrey Sharma
- 63
- 7
0
votes
0 answers
How can I make separate color and button stateless and stateful classes for this code in flutter?
I would like to make an extra file 'extra.dart' where I would like to add my top container and the four TextButtonWidgets.
1 ColorWidget, 4 TextButtonWidgets with each one having colorwidget as their child.
I would name the top container widget…

giannik28
- 403
- 2
- 6
- 14
0
votes
4 answers
Can't get Flutter Countdown/Timer Widget to count down
I'm trying to create a simple widget which counts down from 10 upon getting built. I expected this to start counting down but it remains stuck on 10. Could anyone see what is going wrong here?
class GameTimer extends StatefulWidget {
const…

Jelle Huevo
- 3
- 1
- 3
0
votes
2 answers
Flutter: How to Call a Function that is in a Stateful Widgets State Class, that depends on the initState, from another external Class
I am unsure if this question has been asked before, but I was unable to find an answer to it.
I have a stateful widget for my signin page, which uses the flutter_toast package for error handling (incorrect password, email already in use, etc.). When…

noahfoe
- 27
- 6
0
votes
1 answer
constructor doesn't work properly on flutter
I have create a class called Size
Class name: Size
enter code
import 'package:flutter/material.dart';
import 'package:firstapp/pages/components/font.dart';
// ignore: must_be_immutable
class Size extends StatefulWidget {
double font =…

ኸይሩ ነጅሙ
- 3
- 2
0
votes
1 answer
How to update widget tree from another widget class - Flutter
I am facing problem to re-render the page when a variable changes in one class/widget (both parent and child widgets are stateful classes).
Here is how it goes:
I have three buttons in one class which changes a variable state (foodCategory).
int…

Bakhtawar
- 107
- 2
- 14
0
votes
1 answer
How to execute function when a variable is not null Flutter
I have this code in _MyAppState in my main.dart :
var _p3provider;
@override
void initState() {
super.initState();
P3provider p3provider = new P3provider();
authentification(p3provider);
_p3provider =…

JS1
- 631
- 2
- 7
- 23
0
votes
3 answers
Flutter: setState() called in constructor
I am novice in Flutter, and ran upon a problem trying to show a map and implement some tilelayers.
The app has a Drawer implemtation where I want to enable/disable and clear the tile cache.
I have fetched some examples where this was working well,…

Roar Grønmo
- 2,926
- 2
- 24
- 37
0
votes
1 answer
How to make a sparkline stateful widget to add new points along the time in flutter?
I have a stateful widget that draws a one from a list of points stored locally:
class Sparkline extends StatefulWidget {
@override
_Sparkline create() => _Sparkline;
}
class _Sparkline extends State {
List _points =…

Stéphane de Luca
- 12,745
- 9
- 57
- 95
0
votes
1 answer
Flutter streambuilder does not update a statefulwidget or statelesswidget
I'm trying to build a streambuilder.
My problem is that the streambuilder does not update other statefulWidgets inside the streambuilder widget.
Here my code:
class ChatPage extends StatefulWidget {
//pass parm
var chat_object;
…
user16754196
0
votes
1 answer
Flutter: Update children state from change in parent
NOTE: The code may seem very long, but for this question you don't need to understand every part of it.
I have an app, which gets data from an API to build a chart with it. I use the Syncfusion cartesian chart package. This is an economic indicator,…

Matías Baeza Graf
- 123
- 7
0
votes
0 answers
Read TextField input and show as a Text widget in Flutter
I am trying to implement an UI as below.
App UI figure
User types his name in the TextField widget and press the button. His name will show as a text widget below the button. I know the StatefulWidget should be used to rebuild the text widget for…

Henry
- 41
- 3
0
votes
1 answer
How to send stateful widget data in flutter?
class Body extends StatefulWidget {
int? pageIdx;
Body({@required this.pageIdx});
@override
State createState() => _MainContetns(pageIdx: pageIdx);
}
class _MainContetns extends State {
int? pageIdx;
…

Sanghun Yang
- 59
- 1
- 2
- 10
0
votes
0 answers
How to update UI after PopupMenuItem is dismissed in flutter
I have an issue with updating the UI right after popupmenu is dismissed. The item being clicked actually is being deleted but updating it is the problem. I understand that I am calling this method from an unstatefull class that extends…

Davis
- 1,219
- 2
- 8
- 17
0
votes
1 answer
flutter:: Is it possible to load statefulwidget as a second page?
I have main.dart, a.dart and b.dart.
When I run main.dart, the results of a and b are all displayed in one page. But I want the results of a and b to be displayed on different pages.
So I used MaterialPageRoute to make a visible on the first page…

lele
- 91
- 6