Questions tagged [changenotifier]
33 questions
14
votes
10 answers
PlatformException(multiple_request, Cancelled by a second request, null, null) in imagePicker
I am using a riverpod provider class to handle picking of image from gallery. However, once an image is picked, I get the error: PlatformException(multiple_request, Cancelled by a second request null, null). Not sure where a second request is coming…

Obisi7
- 485
- 1
- 5
- 18
4
votes
2 answers
Error: Could not find the correct Provider< > above this Widget
I can't see what I've done wrong in the following, but it's throwing a few provider errors and buildcontext:
This happens because you used a BuildContext that does not include the provider
of your choice. There are a few common scenarios:
You added…

Carryn W. Kerr
- 85
- 1
- 6
3
votes
2 answers
Flutter Riverpod: how to pass multiple arguments in family?
I can pass one argument along with ProviderScope in Riverpod ChangeNotifierProvider family. But I need to pass more than one/multiple arguments/dependencies.
For example I have to pass context to access other providers value via…

Golam Sarwar Shakil
- 115
- 4
- 9
2
votes
3 answers
MultiProvider with AbstractClass notifier
I am trying to create a single interface for Google and Facebook login, my SignInProvider looks like:
abstract class SignInProvider with ChangeNotifier {
bool get isSigningIn;
set isSigningIn(bool isSigningIn);
void login();
void…

itsji10dra
- 4,603
- 3
- 39
- 59
2
votes
2 answers
Flutter multiple notifyListeners calls
I use notifyListeners from ChangeNotifier in flutter. What happens if I call notifyListeners() three times in a row? How many times will the UI be updated in this case?
notifyListeners сall code:
class Data with ChangeNotifier
{
String _data =…

House MD
- 35
- 5
2
votes
2 answers
Not sure how to properly implement ChangeNotifierProvider for remembering logged in User in Flutter
I've got an app with working user registration, and using a user provider am able to set the user during registration and retrieve it on the following screen without issue. What I'm having trouble with is trying to properly implement the ability to…

MMDev
- 21
- 3
1
vote
1 answer
How to create unique instance of provider class for reusable widget in Flutter?
I am creating a Cart screen where items added to cart are listed. I have a list of item tiles that has name, image, price and the number of item. The number of item has two buttons that increases and decreases the number. When I increase/decrease an…

Shrijal Shrestha
- 13
- 5
1
vote
1 answer
ChangeNotifierProvider not updating the listener
I have simplified my real app into the following code below to show the problem. I am basically trying to show the scroll offset of a list view on another widget (the real app is a lot more complex where the widget does other stuff with that…

sudoExclaimationExclaimation
- 7,992
- 10
- 47
- 105
1
vote
1 answer
Flutter Changenotifier provider getting disposed after closing and opening of bottom model sheet
In my Flutter app, I have this ChangeNotifier provider. On the homepage a ChangeNotifier is created.
ChangeNotifierProvider(create: (_) => UserTeam()),
I am setting the value for this provider on button press using this code below.
late…

fazilSizzlers
- 195
- 10
1
vote
2 answers
How to create one time listener for ChangeNotifier in dart
I want to add a listener to a ChangeNotifier. And trigger this listener only once.
For example:
final changeNotifier = ChangeNotifier();
changeNotifier.addListener(() {
debugPrint("Run…

Yanni
- 580
- 2
- 6
- 21
1
vote
3 answers
How ChangeNotifier notify the state?
Can someone give me idea how provider notify the state?
I don't want to use ChangeNotifierProvider, Can you give me a suggestion without library?
I just need better explanation with example.
How provider combine InheritedWidget.

Raiyan Safir
- 23
- 1
- 5
1
vote
2 answers
How to listen to multiple sources in flutter using a ChangeNotifier?
I have the widget whose text needs to update based on what is entered in two TextFields. What is the right way to listen to two sources in this situation (and in general)?
I just wrote two classes:
class MyTextField extends StatelessWidget {
const…

House MD
- 35
- 5
1
vote
1 answer
provider above openContainer of bulderFunctions
ChangeNotifierProvider(
create: (context) => BuyValuableNotifier(),
child: OpenContainer(
closedBuilder: (context, action) {
return Container();
},
…

farzin
- 11
- 1
1
vote
1 answer
Flutter ChangeNotifierProvider issue
I have a ProperyListPage and on each list item clicked this is the action it does.
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChangeNotifierProvider.value(
value: property,
child:…

blupointmedia
- 564
- 2
- 10
1
vote
0 answers
should use changeNotiferProxyProvider on all providers
I have a question
I am building app in flutter for first time and totally new to this language
So usualy we create APIs to get all config data n everything which is needed in app so that I can change anything in app remotely without pushing builds…

siddhant sankhe
- 623
- 6
- 12