Questions tagged [flutter-state]
369 questions
1
vote
1 answer
Problems with flutter bloc/State Management-How to pass objects between pages?
My internship boss asked me to solve a problem which I am not being able to do so far.
I have been given an ready application. This is basically flattered attendance app.
Now let me tell you clearly where I'm facing the issue.When the user click the…

Habeeb E Sadeed
- 49
- 7
1
vote
2 answers
Flutter - Getx Obx not updating a value
I’m using a widget for collecting user phone contact. The behavior I am expecting is that if there are values for phone numbers, it should be displayed in that widget. On init I’m retrieving the data that needs to be shown in that widget.
void…

Febin Johnson
- 277
- 1
- 6
- 21
1
vote
1 answer
CupertinoTabBar and BottomNavigationBarItem UI not updating with ChangeNotifierProvider
I'm using Flutter Provider package for managing currentIndex state of CupertionTabBar. I'm doing this instead of using setState of StatefulWidget because I want to programmatically update current active tab from within the tab view pages.
Here's the…

rmalviya
- 1,847
- 12
- 39
1
vote
0 answers
Flutter. How to correctly update state of nested widgets?
I'm new in flutter and I'm trying to implement something like radio group with custom buttons in Android. For this I created StatefulWidget, which hold list of selectable buttons. For every button I was set press listener where I do something like…

testivanivan
- 967
- 13
- 36
1
vote
0 answers
State Provider's unsupported Error: Failed assertion: 'T != dynamic'. Tried to call Provider.of
I'm getting this error when I click on a Video Card. The video with details will be moved to the mini-player. The Error shows Provider.of, but I'm not using Provider.of, instead I'm using StateProvider I've tried with a…

M Nouman
- 437
- 1
- 5
- 22
1
vote
2 answers
Flutter : Can't access data passed from another screen
I'm trying to build 2 screens one contains a list of products and the second has product details, I'm using Firebase to store data and so I fetch the data from Firestore in the first screen and it all works perfectly.
However, in the second screen,…

Yacine Labdaoui
- 33
- 2
1
vote
2 answers
Could not find the correct Provider above this Test widget
======== Exception caught by gesture ===============================================================
The following ProviderNotFoundException was thrown while handling a gesture:
Error: Could not find the correct Provider above this Test Widget
This…

Abdullah Al Masum
- 11
- 1
- 3
1
vote
3 answers
GetIt plugin Stack Overflow Error when two classes depend on each other
I get the Stack Overflow error when I have the following design:
I get that the problem is the first dotted arrow.
Here it is in the code:
timer_container.dart
import 'package:flutter/material.dart';
import…

Tomas Baran
- 1,570
- 2
- 20
- 37
1
vote
0 answers
Changing animation of Navigator.of(context).pushNamedAndRemoveUntil in Flutter
I need to reload the initstate after pop back.I put method below into WillPopScope.
Navigator.of(context).pushNamedAndRemoveUntil(
NewHomeScreen.routeName,
(Route route) => false,
);
The problem is that this…

cvsrt
- 357
- 4
- 19
1
vote
2 answers
Can't seem to workout why my BlocProvider is failing
I am re writing Reso Coder's TDD clean architecture course with some minor changes. End goal is to have the exact same content with latest version of flutter with updated libraries & also to have the option of Riverpod state managment. But while…

midNight
- 155
- 1
- 4
- 18
1
vote
2 answers
Flutter Riverpod UI change only when i hot-reload
When i call toggleFavorite function using a icon button the state is changing but ui not update but when i hot reload it's update. i checked some similar question on stackoverflow but i couldn't figure it out.
class ProductsNotyfier extends…

Nashaf
- 23
- 7
1
vote
4 answers
How manage state of different widgets in ListView flutter?
I am building a Flutter App where a List is shown using ListView. Which returns a ListTile with User Information. The ListTile contains a leading, title and subtitle with trailing set as a ElevatedButton.
Here's how it looks like:
I want to tap on…

Haris Ijaz Warraich
- 95
- 1
- 6
1
vote
1 answer
"Minimizing" the current screen in Flutter
I'm building an app where I ping some data in my screen with the StreamBuilder (time, location, etc.), now I want to make an option for the user to leave the current screen without breaking the state or context of the screen, sort of like minimizing…

GrandMagus
- 600
- 3
- 12
- 37
1
vote
3 answers
Flutter use BlocListener and BlocBuilder inside MultiBlocProvider
In my program, I have two different Blocs bloc1 and bloc2. I use MultiBlocProvider and add those two blocs. now I want to use BlocListener and BlocBuilder both inside the MultiBlocProvider. For bloc1 I want to BlocBuilderand for bloc2 I want to…

Akila Ishan
- 147
- 2
- 12
1
vote
1 answer
Flutter Riverpod: using ref.watch in the constructor for a ChangeNotifier, how to avoid Notifier being recreated upon changes
I have a ChangeNotifier, which I use with ChangeNotifierProvider to track the state of a screen in my app. It has a constructor:
CategoryViewState(ProviderRefBase ref, int listId) {
subjects = ref.watch(otherProvider.select((value) =>…

mosh.jinton
- 188
- 11