statefulwidget Questions

9

Solved

I'm wondering what the recommended way of passing data to a stateful widget, while creating it, is. The two styles I've seen are: class ServerInfo extends StatefulWidget { Server _server; Ser...
Getter asked 12/6, 2018 at 13:43

10

Solved

I have 2 screens in my Flutter app: a list of records and a screen for creating and editing records. If I pass an object to the second screen that means I am going to edit this and if I pass null i...
Screens asked 11/5, 2018 at 8:16

2

I'm currently learning Flutter. I tried to deep dive into Flutter Widget life-cycle, and I wonder why StatefulWidget are written like this : class Example extends StatefulWidget { @override _Exa...
Wein asked 16/8, 2019 at 2:30

2

Solved

Peace be upon you I am researching Flutter's widget lifecycle and stopped at a point which is the this.mounted boolean variable, it does exist directly in the State class, which can only be connect...

5

I am a newbie in the world of flutter, and I recently learned (or I think I did) about stateful and stateless widgets which is kind of the base for flutter widgets. We use stateless widgets for th...
Surrealism asked 5/9, 2019 at 5:19

4

Solved

I'm just starting to fiddle with Flutter and I can't understand the point of StatefulWidget. All those widgets do anywhere I've seen in tutorials etc. is instantiate a State<MyWidget> and let...
Jiujitsu asked 19/6, 2018 at 20:22

1

Solved

I'm an unique person. I mean I'm different from all other persons in this world. When I create an UniqueKey in flutter, what's the world in which it's different from all the others?
Vote asked 28/5, 2021 at 3:43

3

Solved

I'm trying to preserve the state of a widget, so that if I temporarily remove the stateful widget from the widget tree, and then re-add it later on, the widget will have the same state as it did be...
Abnormal asked 29/12, 2019 at 2:33

2

Solved

In my Flutter Widget I have a StreamBuilder that checks for snapshot.hasError and in this specific case it will return my ErrorRetryWidget(). builder: (context, AsyncSnapshot<MyObject> snaps...
Athome asked 11/6, 2020 at 20:25

1

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://mcmap.net/q/210481/...
Gertrudis asked 12/12, 2020 at 1:40

1

I'm trying to build an app using Flutter and am running into a small problem. I'm trying to implement a BottomNavigaionBar style app with three pages. (see first snippet) The layout makes use of th...
Vertumnus asked 5/7, 2020 at 14:2

3

Solved

I am learning flutter and I am working with tabBars and I am having an issue with saving the state. I have put a small working example of my issue below. Basically, there is a button and a stateful...
Fbi asked 14/6, 2018 at 14:26

12

A stateful widget is defined as any widget which changes its state within its lifetime. But it is a very common practice for a StatelessWidget to have a StatefulWidget as one of its children. Doesn...
Phlogistic asked 26/11, 2017 at 22:32

1

I want create statefulWidget and want in this widget get parent widget height. Don't want do this by sending height data from parent widget. How can I do this?
Chrysalis asked 13/7, 2020 at 5:56

3

Solved

I have a StatefulWidget widget with a LinkedHashMap member done like this: LinkedHashMap _items = new LinkedHashMap<String, List<dynamic>>(); Now I need to filter the items inside th...
Slipshod asked 15/12, 2019 at 11:31

2

Solved

What I am trying to achieve is to save the state of the Widget i.e it should not refresh when the setState() method is been called. class _GenderSelectionPageState extends State<GenderSelection...
Leonoreleonsis asked 24/2, 2020 at 10:47

2

Solved

I'm adapting a class from Wikipedia Explorer (open source) to browse pre-selected pages. I'm trying to add a page counter that it doesn't update because it is a StatelessWidget. Can someone help me...
Nela asked 27/1, 2020 at 11:16

3

Solved

In my profile page have edit option when use click edit icon i change Text widget to TextField Widget using Boolean condition like widget.isUpdate ? new Flexible(child: new TextField()) : Text(&quo...
Bayne asked 25/12, 2018 at 7:10

2

Solved

One of Flutter's mantras is that widgets are immutable and liable to be rebuilt at a moment's notice. One reason for the StatefulWidget is the accompanying State object, which 'hangs around' beyond...
Arthritis asked 1/8, 2019 at 5:32

1

Solved

I've build a Custemized List. Now I include a Checkbox and if I would checked or unchecked , the following error was thrown: 'setState() called in constructor' class Lists extends StatefulWidget{ ...
Istic asked 28/6, 2019 at 12:36

3

Solved

Just testing out flutter. The code sample below is a very simple flutter app. The problem is that I don't know how to call the setState() function inside the TestTextState class in order to change ...
Canberra asked 22/10, 2018 at 13:25
1

© 2022 - 2024 — McMap. All rights reserved.