How to display a dialog from ChangeNotifier model

In my project, when <code>ChangeNotifier</code> class receives a status it sets up a boolean and calls <code>notifyListeners()</code>. In my main <code>build()</code>...

ChangeNotifierProvider between different pages

I've been searched but I didn't find any question (sorry If I there is some yet...) My question is: I have two pages, I use ChangeNotifierProvider in this two pages, b...

Having difficulty adding items to shopping cart - Flutter

I have my <code>Cart</code> model as below <pre><code>class Cart { String description; double unitCost; double amount; int quantity; String color; Stri...

ChangeNotifier changing but widget not updating with gestureDetector

I have this simple changeNotifierProvider here it is <pre><code>import 'package:flutter/material.dart'; class CreatePetProvider extends ChangeNotifier {...

How to use Flutter hooks with ChangeNotifer

Assume we have a complex Model with <code>ChangeNotifer</code>, so how should I automatically update the UI when model changes? Here is what I came up with, but...

How to implement Change Notifier along with moor?

I am trying to make an app having a database it has a table <strong>Students</strong> <pre><code>class Students extends Table{ IntColumn get RollNumber=&gt;in...

ChangeNotifier listeners and dispose. Memory leaks?

I am curious if creation of new objects removes all attached listeners. Here it is simple code: <pre class="lang-dart prettyprint-override"><code>class Notifier ex...

Flutter Popup Widget in a Provider - What context to pop it closed?

I have a ChangeNotifierProvider class that provides a popup to its Consumer Widgets. The popup function called showPopup contains a raised button which whe...

Flutter Provider: How do I listen to a change of a class field inside a class field?

Given the following Dart/Flutter class structure: <pre class="lang-dart prettyprint-override"><code>import 'package:flutter/material.dart'; class A with ChangeNo...

Flutter: Subtype Error when creating an widget with generics

I'm using viewmodels for my app that extend ChangeNotifier. To use them I'm trying to implement an generic base widget: <pre class="lang-dart prettyprint-override...

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 i...

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 patt...

Error: Undefined name Brightness when running flutters ChangeNotifier test

I have the following class: <pre><code>import 'package:flutter/foundation.dart'; class TogglesListViewModel extends ChangeNotifier {} </code></pre> And a co...

how to let consumer listen to multiple parameters in flutter?

I need to let the consumer widget listen to multiple variables depending on a boolean value. this is the model class <pre><code> class Lawyer{ Data? da...

Can write userData to Firebase, Cant read from Firebase into fields : Flutter

I'm trying to read my UserData into form fields when the user tried to edit their information. I can write to Firebase, but I can't read and display user data into the...