Questions tagged [statefulwidget]

339 questions
0
votes
1 answer

Flutter: setState does not update inner widget

I have a song playlist screen that includes a list of songs and a navbar for audio play/pause. I set the initial value of the song field as the first element of the songs list, however, when I update the selected song with setState(), the navbar…
0
votes
1 answer

Flutter statefull widget not updating svg icons

Hi I'm learning flutter but having this problem. I'm trying change svg icon when user click on menu item but icons not changing. When click on menu item I need change icons. class BottomNavigation extends StatefulWidget { const BottomNavigation({ …
0
votes
3 answers

Stateful widget not rebuilding

In following code, there's a Greetings list, a Text widget and a 'Refresh' Elevated button. The entire app is a Stateful widget. I want the Text to change to the next greeting from the User list, when the user clicks the Refresh button. However,…
Ajith R
  • 3
  • 2
0
votes
1 answer

Flutter StatefulWidget parameter unable to pass

I know there was a really similar case and got solved, I modified my code to 99% liked to that but somehow my list is undefined. The list that is undefined is at the line where ' ...(list as List).map((answer) { '. import…
Exusiai
  • 77
  • 1
  • 9
0
votes
1 answer

Access State variable from outside the widget

So I've made PageViewer and I wasn't able to use Navigator inside of it, instead what I'm trying to do is to pass diferrent widget inside using StatefulWidget that return functions, I want to access said StatefulWidget and change variable inside of…
0
votes
1 answer

Why stateful/stateless widgets extends and doesn't implements?

I have this question for a job interview, and i want to know why the stateful and staless widgets, use extends and why not use implements in Flutter/Dart?
0
votes
1 answer

How to prevent multiple StatefulWidgets (ImageSliders) from overriding each others contents?

So I am trying to place three ImageSliders on the same page/card. They are quite similar which is why I created one class and just wanted to pass changing values over. That didn't really work as intended: now there is just three times the last…
0
votes
1 answer

Flutter: setState() called after dispose() error

This is actually a working Google Map with with a google place search. The problem is upon disposing this Stateful Widget, I am getting this error: E/flutter ( 6017): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: setState()…
Jang Delos Santos
  • 129
  • 1
  • 4
  • 19
0
votes
1 answer

Why the state of widgets is not changing on flutter?

I am using a variable column whose children has stateful methods, for example: String word = 'hi'; Column c = Column( children: [ FlatButton( child(Text(word)), onPressed() { setState({ word += word; }) } ) // Flat Button ] ); but setState won't…
Fahad
  • 1
  • 1
0
votes
1 answer

How to access a widgets state from a stateful widget class Flutter

Sorry if this has been already answered somewhere else but I am new to Flutter. I have a toString method in my widget below that needs to access the state of the widget to output the string. The widget is a card that contains a text field and other…
Davin Seju
  • 89
  • 2
  • 6
0
votes
1 answer

Flutter Listview items not rendering

What I do is fetching items from Firebase then saving them in a list and then I display them in a ListView. The Problem that I have now is that I check if the list has Items and if so it displays my ListView with the Items and if there are no items…
DEFL
  • 907
  • 7
  • 20
0
votes
2 answers

How do I access an variable from a StatefulWidget inside an StatelessWidget?

How do I access the variable "selectedTag" from this statefulWidget: class _AlertDialogOneState extends State { Item selectedTag; ... } } inside this statelessWidget : class CardTile extends StatelessWidget { @override …
0
votes
1 answer

Flutter Slider (activeTrackHeight and inactiveTrackHeight)

Why activeTrackHeight and inactiveTrackHeight length are different ? I hope they are the same length. How do I fix my code ? please help. I use Android studio 4.0 and Flutter 1.22.3 I tried some custom slider packages and searched for solutions in…
0
votes
1 answer

How do I get a black banner with text to dynamically show depending upon what a user does on another screen in Flutter?

I am tasked with the challenge of getting a black banner to show when a user returns from a screen on that same tab upon ordering an item on another screen. The current code below only shows the black banner appropriately if the user leaves by…
michaeldebo
  • 3,065
  • 4
  • 14
  • 20
0
votes
1 answer

Flutter: combining stateful widgets into a flutter-redux app architecture

Following this question, I understand why StatefulWidgets do make sense in the context of a Redux-based flutter app. And that's what I'm trying to accomplish as well- a Page that is "fed" information from the app-wide state (logged in user details,…
Maor Barazani
  • 680
  • 3
  • 12
  • 31