Questions tagged [flutter-change-notifier]

189 questions
0
votes
0 answers

ChangeNotifierProvider for multiple inheritence

I have the following service structure instead of having a single huge class A: class A extends ChangeNotifier { ... } class B extends A { ... } class C extends A { ... } class D extends A { ... } I can do the following: MultiProvider( …
Omar Fayad
  • 1,733
  • 3
  • 11
  • 27
0
votes
1 answer

Flutter ChangeNotifierProxyProvider ChangeNotifier in create needs arguments

I am in the process of programming my app and need to use a ChangeNotifierProxyProvider. Unfortunately my ChangeNotifier (in this case Entries) needs 3 positional arguments. I already managed to specify the arguments in update, but how can I do it…
0
votes
2 answers

ChangeNotifierProxyProvider not initiated on build

I'm trying to understand multiproviders in Flutter. In my App, one Provider need to change based on a value from an other Provider. AuthProvider gets initiated higher up in the widget tree on build. Works like a charm with automatic sign in if…
0
votes
1 answer

Why my app (developed using ChangeNotifierProvider) updates with one level delay?

I'm developing a flutter app and I've used ChangeNotifierProvider to manage states.I have a class called 'Data' which is the model of the app (model in MVC design pattern) and a class called 'DataManager' which is the controller of the app…
0
votes
1 answer

ChangeNotifier not listening to value change

I want to notify the wrapper when a value changes from null to a number, but the wrapper seems not to receive the change. Check my code below: class setID with ChangeNotifier{ String studyID; void setStudyID(String study){ studyID = study; …
0
votes
1 answer

How to listen to changes of a singleton class that extends changeNotifer with getit package?

I'm using getit package from flutter. How to listen to changes of a singleton class that extends changeNotifer with getit package? class UserService extends ChangeNotifier { Database _db = serviceLocator(); User user; Future
Ramesh Kumar
  • 147
  • 14
0
votes
2 answers

How to use Flutter Riverpod to act like a ChangeNotifierProxy Provider?

just wondering if there is any way to use the Riverpod Package in a way, that it works like the ChangeNotifierProxy Provider. I have made this simple code where the "MySecondClass" shall be updated when 'MyFirstClass" changes its properties. In the…
0
votes
1 answer

Why does my variable not update in a class using Flutter Provider and ChangeNotifierProxyProvider?

Why does my variable 'number' in class1 is not changing when I call the addNumber(){...} method in my code? The print statement "print(class2.numberFromClass1)" returns only the value which I stored directly in class1 and not the new value which is…
0
votes
2 answers

Data transfer between pages with ChangeNotifierProvider in Flutter

I'm developing an application with Flutter. I split the screen in half. There are buttons on the upper screen. The pages at the bottom of the screen will change as you press those buttons. I used ChangeNotifierProvider for this working. But it gave…
0
votes
1 answer

Update Widget on Update Status with ChangeNotifierProvider

I am new to Flutter and I am trying to make the UI refresh the page whenever there's an action triggered by the user, e.g. on button pressed to update this order item status. I have the following codes for my widget with ChangeNotifierProvider. …
doremi666
  • 121
  • 3
  • 15
0
votes
3 answers

Flutter: Can't get File from ChangeNotifier

I am trying to learn provider in flutter. But I am facing a problem. I want to get File _image from ChangeNotifier But it's showing me error. Here is ChangeNotifierProvider class ImagePicker extends ChangeNotifier { File _image; final picker =…
Abir Ahsan
  • 2,649
  • 29
  • 51
0
votes
1 answer

Flutter – question about architecture, providers and fetching data from server

I am a rather fresh Flutter programmer so please excuse any flaws in the questions below… I am struggling with a structural/ architecture dilemma. Here is the background: App rationale: my app allows its users to check little jobs available in…
0
votes
2 answers

Could not find the correct Provider above this AddSupervisor Widget

HomeSupervisor class import 'package:flutter/material.dart'; import 'package:fyp/provider/supervisorProvider.dart'; import 'package:fyp/screen/AddSupervisor.dart'; import 'package:fyp/sidebar/AdminDrawer.dart'; import…
user13411295
0
votes
1 answer

Flutter/Dart - Photo changed but not the URL, therefore Provider's Consumer is not Refreshed

I'm using Provider with ChangeNotifier to alert a Consumer once a new photo is uploaded to a server replacing an old photo. The problem is that the URL stays the same as the photo is merely overwritten and keeps the same name. Hence the Consumer…
Meggy
  • 1,491
  • 3
  • 28
  • 63
0
votes
1 answer

Flutter/Dart - How to update Image after Image Picker on other Screens

I'm using Flutter's Image Picker plugin in order to allow the user to change their avatar. When they go to their account page they see their regular avatar photo with a camera icon on top. Clicking the camera icon will allow them to either take a…