Questions tagged [flutter-change-notifier]
189 questions
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
1 answer
is there any way to use ChangeNotifier with ValueListenableBuilder
I have this example ChangeNotifier:
class ExmapleNotifier extends ChangeNotifier {
bool isDark = false;
toggleTheme() {
isDark = !isDark;
notifyListeners();
}
}
when I try to use it with a ValueListenableBuilder, it throws an error…

Gwhyyy
- 7,554
- 3
- 8
- 35
2
votes
1 answer
how to update variable using changeNotifierProxyProvider?
I am trying to update my header when I retry my API upon 401 response I am able to retry but my header is taking the previous value but not updated value
following is my changeNotifierProxyProvider
ChangeNotifierProxyProvider(
…

Santosh Kumar
- 158
- 1
- 14
2
votes
2 answers
When I change an object's attribute it does not persist in the object somehow, knowing that object is inside a change notifier class?
My project is a quiz game. I have GameController class that extends ChangeNotifier and accessed throughout multiple widgets. in GameController I have a Game type attribute which has a list of teams List\.
class Player {
String name;
int…

zied kanoun
- 23
- 5
2
votes
1 answer
StreamBuilder / ChangeNotifierProvider- setState() or markNeedsBuild() called during build
Streambuilder, ChangeNotifier and Consumer cannot figure out how to use correctly. Flutter
I've tried and tried and tried, I've searched a lot but I cannot figure this out:
I'm using a Streambuilder this should update a ChangeNotifier that should…

Mirakle
- 33
- 4
2
votes
1 answer
flutter - Image picker - need to convert 'List' to 'List?'
I'm using image_picker package to get images and show them in a carousel.
postNotifier(true).selectedPostImages != null
? Container(
height: 400,
width: 400,
child: CarouselSlider.builder(
…

rawm
- 251
- 5
- 24
2
votes
1 answer
How to update a "ChangeNotifierProxyProvider" in the new version of the flutter?
I am trying to update an old Flutter code, this is the original code:
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
…
user11874694
2
votes
1 answer
ChangeNotifier was used after being disposed
I am new to Flutter and stuck with this
I have a page that uses a class named GoogleMapsNotifier with ChangeNotifier and when I pop the page I want to dispose the Stream inside this class (last function).
class GoogleMapsNotifier with ChangeNotifier…

TonyWyomy
- 570
- 5
- 17
2
votes
1 answer
Why is Flutter dialog not rebuilding on change notifier?
Well the issue is kinda simple, but it needs to be done on a specific way. First I have a Class extending "ChangeNotifier" this class will perform some async tasks, so while it is doing so there's a variable that indicates if the class is currently…

Luis Castañeda
- 23
- 4
2
votes
1 answer
I need removelistener before ChangeNotifier disposed?
For example, i am call the controller.dispose() when page dispose, i also have to call the controller.removeListener?
TextEditingController _controller = TextEditingController();
@override
void initState() {
super.initState();
…

xyh
- 33
- 3
2
votes
0 answers
Flutter: ChangeNotifier issue on Navigation 2.0 with nested ChangeProvider inside page
I've trying to create flutter apps using the new Navigation 2.0 with using MVVM pattern. Overall I got an issue when try to update my page from my starting Page that contain ChangeNotifierProvider this is how my code…

Davin Reinaldo Gozali
- 151
- 1
- 15
2
votes
4 answers
Change card color based on alertdialog option
I have a list of cards and each card has a long press function which when clicked, pops up an alert dialog. I would like the card to change color based on the option chosen in the alert dialog. My alert dialog has 3 options:
Completed (Card should…

mcfred
- 1,183
- 2
- 29
- 68
2
votes
2 answers
How to use changeNotifier in flutter with provider
I am using a provider package for my project. I made two functions in my Auth model with ChangeNotifier. The first one is authenticate and the second one is tryAutoLogin. If I call the tryAutoLogin function then the getter gets the value of like…

Shahryar Rafique
- 1,211
- 15
- 35
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
2
votes
1 answer
ChangeNotifierProxyProvider flutter not getting update from ChangeNotifierProvider
I am trying to access userModel.uid from UserProvider inside the ItemProvider so it can load _savedItems.
However, when I call loadUserSavedItems(), _userId is null.
Here is my main.dart
import 'package:flutter/material.dart';
import…

Vibor
- 75
- 1
- 2
- 5