Questions tagged [flutter-change-notifier]

189 questions
0
votes
0 answers

How to update UI from background service in Flutter?

I count step from background service in order to count steps when app is inactive also with flutter. So I use flutter_background_service package. And in onStart method, I call stepEventCount.initializeStepCount(). class StepNotification { …
Hyejung
  • 902
  • 1
  • 8
  • 22
0
votes
1 answer

Can a ChangeNotifier listen to another ChangeNotifier's state flutter

I have two classes, AuthAPI and UserUpdate. both extends ChangeNotifier. The update() method under UserUpdate updates the the user. I am trying to trigger the AuthAPI class when the Update class is done updating the user. class AuthAPI extends…
0
votes
1 answer

using ChangeNotifierProvider with FutureBuilder issue

i have a class that is called page1 and within it i have a ChangeNotifierProvider and a consumer as a child which has a FutureBuilder as a child within it, here is the code for it class Page1 extends StatefulWidget { const Page1({super.key}); …
0
votes
2 answers

How can I have a color that is going to change, when I select a certain topic on Flutter. Can I use the notifier with the Color Widget?

So I am currently trying to figure out a way to give a color to a certain card depending on which subject the user has selected. I am usifier a notifier. Previously in my code, I was able to refer to look for a precise image that would be related to…
0
votes
0 answers

Changing value of integer.toString() with Provider in flutter

I am new to flutter. I am trying to display an integer value. The value changes on some conditions. Now I am trying to update the widgets and the displaying value of the integer with Provider / ChangeNotifier but it doesn't work. My…
0
votes
2 answers

Flutter Provider - How to add more info to user model after login

I'd like to add more info the following UserModel and make it available throughout all screens of the app. I've been struggling with the basics of Provider. Should I use a separate class extending the ChangeNotifier and store those additional…
0
votes
0 answers

I want to add a functionality that the user can change the theme of the app by selecting one of the popUp menu Items in appBar

I'm fairly new to the application development using Flutter. I have been trying to solve a problem where I want to implement a functionality in my flutter app, that the user can change the theme of the whole app with the help of a colours in a popup…
0
votes
0 answers

How to mock a Stream builder inside a ChangeNotifier Class?

I have been using StreamBuilders on each page of the app I am developing. The problem I am facing is the lag it causes while switching screens. I understand that stream automatically reads any changes made in the firebase and changes UI accordingly.…
0
votes
1 answer

Is it possible to allow multiple entities to use one global ChangeNotifier in flutter?

I'm designing an application that allows users to view content of their desired integrations (this could be anything such as twitter, bbc.co.uk etc...). I have a settings page in which I would like the user to authenticate the services they would…
0
votes
0 answers

Flutter dynamically change PageRoute / ModalRoute reverseTransitionDuration

I want to change the reverseTransitionDuration of a PageRoute dynamically with state. I initially thought the only way to do this would be to create a StatefulWidget above the PageRoute's Navigator. However, playing around with GoRouter and…
Walrus
  • 19,801
  • 35
  • 121
  • 199
0
votes
1 answer

Accessing data from a main Provider in a sub-Provider in Flutter (Provider refactoring)

I am relatively new to Flutter and I am trying to split my Provider into one main Provider, which holds all my data, and multiple sub-Providers that extend it. These sub-Providers are responsible for manipulating the data and providing some getters…
0
votes
0 answers

Flutter chrome web app login screen never-ending loop with LinkedIn API authorization

After a long time getting the port to allow the LinkedIn API to send the redirect URI by using the command flutter run -d chrome --web-port=3000 the issue is now it just opens a new tab in the window like a new instance of the app, which then resets…
0
votes
1 answer

Flutter DropDownButton not displaying Selected Value

I am currently working on a Flutter App for grocery scanning and organization. I need this drop down button to select where the grocery item is being stored: shelf, fridge, or freezer. This is the code for my function which controls the drop down…
0
votes
1 answer

Save favorite posts in Local with provider in Flutter

I'm currently trying to use Provider to save articles once user tap on bookmark icon, new articles once tapped should show up on favourite page, I don't understand why it doesn't save anything. Below my code used. What do I wrong? ArticleModel class…
0
votes
1 answer

How can I add a switch case inside "MultiProvider" in Flutter?

I am trying to use a code like below: class MultiPageProvider extends StatefulWidget { const MultiPageProvider({Key? key}) : super(key: key); @override _MultiPageProviderState createState() => _MultiPageProviderState(); } class…
best_of_man
  • 643
  • 2
  • 15