Questions tagged [flutter-state]
369 questions
1
vote
2 answers
list view not refreshing in flutter
I am using two bottomnavigationbar item where two tabs for alltodos and completedtodos
here as a demo purpose I have placed a refresh button on AppBar to load data and used setState to rebuild but it does not rebuild list view , therefor to see…

Irfan Ganatra
- 967
- 3
- 13
1
vote
1 answer
There is a problem that is rebuild when I click TextField() in Flutter
My code includes FutureBuilder(), which get data from Firestore, and its child widgets include GridView.builder and TextField widgets etc.
When I click on a TexField(focus), the codes in FutureBuilder are rebuild.
The following is the test code for…

Kevin Yang
- 629
- 1
- 5
- 19
1
vote
1 answer
update a variable of stateful class from another class in flutter
I'm quite new to flutter and dart.
as an exercise I'm trying to create a Coffeeshop application user interface. here I want to update an integer variable in a StatefulWidget from an other StatefulWidget. I've tried the setState((){})
but It seems…

Eric Matevosian
- 135
- 5
1
vote
2 answers
Flutter setstate method doesn't add my numbers
I built custom app for training. I created buttons with gesture detector and i assigned number to them and i created global variable "score". I want buttons to add their numbers to "score" variable and i want to show the variable in a container but…

hasannn2666
- 49
- 1
- 5
1
vote
1 answer
Flutter stateful widget doesn't change container's color on condition?
In my app I generate a random number between 1-10 and i try to guess. I use container and text and gesture detector for it. I want containers to change color if i click on the right number which i generated randomly. But I don't know why i does not…

hasannn2666
- 49
- 1
- 5
1
vote
1 answer
Flutter -Widget Text, not updating when value change even with SetState
I have created a container. His child is a text.
When I tap on the container/text, it display a modal and a Picker.
Then, the user can select a value. Press the confirm button and my text widget should change to display the value selected by the…

Laurent Thomas
- 232
- 4
- 24
1
vote
1 answer
DropdownButton within showModalBottomSheet doesn't reflect value change
I'm trying to add a dropdown list, depending, for Android I'm using DropdownButton, for iOS a CupertinoPicker:
Platform.isAndroid
? AndroidSelect(
items: ([0] + priceOptions),
value: minPrice,
zeroValue: 'no min',
onChanged: (int?…

hansaplast
- 11,007
- 2
- 61
- 75
1
vote
2 answers
How to re-build Page A when a button is pressed in Page B?
I'm working with IndexedStack in order not to rebuild each page while using BottomNavigationBar
// MAIN.DART
class LoggedHandle extends StatefulWidget {
const LoggedHandle({Key? key}) : super(key: key);
@override
State…

faccio
- 652
- 3
- 16
1
vote
0 answers
Cubit - listener does not catching the first state transition
I'm using a Cubit in my app and I'm struggling to understand one behavior.
I have a list of products and when I open the product detail screen I want to have a "blank" screen with a loading indicator until receiving the data to populate the layout,…

JACF
- 117
- 1
- 5
1
vote
0 answers
How to use any state management for my bluetooth app?
I am trying to use a connected bluetooth device on other pages, but I'm unable to do that. I tried to use the provider, but that did not work, parameter passing did not work either.
After testing, I am using the following
I made a class…

Mubashar Ali
- 11
- 3
1
vote
1 answer
Get the value of an integer from a stateful widget from another class in flutter
Learning Flutter and I am building a counter that I would like to use for a cart. I have a problem retrieving the integer value of the counter stateful widget I created and i'd like a Text to update itself with the value of the Counter.
Here is the…

thearach
- 27
- 4
1
vote
0 answers
Best practices to change app state from a package
I'm developing a standalone package which is currently inside an app like this: app/packages/my_package
I created the package with the create command package template.
What I'd like to achieve is to trigger state changes in the app from package…

holparb
- 157
- 3
- 13
1
vote
1 answer
Flutter Counter Application using Bloc Pattern v8.0.1 [The operator '+' isn't defined for the type 'CounterState'. Try defining the operator '+']
I'm new to the flutter_bloc state management and I have a problem in the bloc class and state class. The operator '+' isn't defined for the type 'CounterState'.
Try defining the operator '+'.
I follow Felix Angelov's instructions here in [Proposal]…

Miguel Rosal
- 119
- 1
- 6
1
vote
1 answer
Flutter progress indicator with slow async method
when i try to use CircularProgressIndicator with slow async method, indicator is not shown. When i replace slow custom method with Timer.pereodic() that works fine. I am new in Flutter and do not understand what i am doing wrong
class…

ohlushenok
- 13
- 2
1
vote
1 answer
Flutter change state on all list item
Hey I am a newbie in flutter, I am trying to build an interview radio app
The issue I am facing is when changing state on switching music from one station to another, the "playing" and icon still don't change for the previously clicked object, but…

Kavi Harjani
- 661
- 5
- 15