Questions tagged [flutter-change-notifier-provider]

21 questions
0
votes
1 answer

Flutter - ChangeNotifierProvider crash when ListView items are cleared - setstate or markneedsbuild() called during build

I am trying to build my own custom pull to refresh indicator for ListView. I am using a ChangeNotifier whose offset variable gets updated by the ListView's scroll controller. My custom refresh indicator uses a Consumer to update its UI and also if…
0
votes
1 answer

How use ChangeNotifier and Consumer in custom flutter app bar?

I'm using MultiProvider in my home page on flutter app and work done. But I have a custom App bar which contain a ChangeNotifierProvider with a consumer and not working. AppBar widget are not notify when notifyListener() function called. home…
0
votes
1 answer

Problem pulling data from GetIt to stream builder

Error text: Null check operator used on a null value The relevant error-causing widget was StreamBuilder ChangeNotifierProvider( create: (context) => getIt(), child: StreamBuilder( stream:…
0
votes
3 answers

'Change Notifier Provider' isn't a function error message

I am building a spelling app. This is the code that's giving me an error. I don't know what I'm doing wrong. void main() { runApp(ChangeNotifierProvider(create: (_) => Controller(), child: MyApp())); } The error message…
0
votes
0 answers

Multiple notifyListeners in flutter ChangeNotifier trigger only one build in widget

I have Flutter app with simple Provider and Consumer flow class SomeProvider with ChangeNotifier. My SubscriptionProvider has next methods: methodA() async { isLoading = true; data = {}; notifyListeners(); await…
0
votes
1 answer

My Counter made with ChangeNotifier Provider replicates its value with other Counter Instances

I am creating a counter for a shopping cart. The problem is when the value of one counter changes, it affects all the other counters on the screen. I used ChangeNotifier and I have no idea what I am doing wrong. This is the Counter Model import…
1
2