Questions tagged [state-management]
1074 questions
14
votes
4 answers
How to Refresh the UI in ListView.Builder using flutter GetX when data is changed?
I'm refactoring my app to GetX state management for less boilerplate code.
I make the Controller and the API provider (code below).
But when I want to refresh the data (Manually too) it won't change.
home_page.dart
class HomeUI extends…

J.Maher
- 312
- 1
- 4
- 14
14
votes
4 answers
Python with statement in C++
I am trying to implement something similar to the Python with statement in C++. As I plan to use it mainly with Qt-OpenGL the methods are called bind and release (in Python __enter__, __exit__).
Code I came up with:
header:
#include…

tauran
- 7,986
- 6
- 41
- 48
12
votes
2 answers
Best practice regarding StateManager in Ember.js
The StateManager in Ember.js isn't that well documented yet, so I've got some questions regarding its usage.
Should one strive to call .goToState only from within the state manager?
I sometimes find myself mirroring methods in the state manager on…

sandstrom
- 14,554
- 7
- 65
- 62
11
votes
2 answers
How to use a riverpod family provider without passing parameter
Is there a way to access an instance of a provided ".family" change notifier (which has already been instantiated, passing the right parameters) without passing the parameters again?
IN PROVIDER
When you create a provider of a ChangeNotifier (which…

Prince
- 245
- 4
- 9
11
votes
2 answers
Dispatch is not a function useContext/useReducer React hooks
My Home.js component just doesn't seem to see the dispatch function at all. Do you guys know why? I'm kinda new to redux style state management stuff in redux.
I keep getting the error "TypeError: dispatch is not a function"
App.js
import React from…

pyan
- 865
- 2
- 12
- 23
10
votes
2 answers
Does setState rebuild the whole widget tree for a screen in flutter and how does it compare with other State management
I'm kinda confused, I have been looking into state management with flutter recently and I was wondering what happens if a custom stateful widget is placed in a stateless widget, let's say widgetA (parent) is a stateless widget and it has a child…

Nayef Radwi
- 1,305
- 13
- 25
9
votes
6 answers
How to keep data through postbacks?
I am working on a ASP.NET/C# Website.
I am reading data from a database, saving it in a Dictionary
Dictionary Results
and then binding it to a ASP.NET chart
PieChart.Series["Series"].Points.DataBind(Results, "Key", "Value",…

Y2theZ
- 10,162
- 38
- 131
- 200
9
votes
4 answers
ASP.NET MVC - Is there a way to simulate a ViewState?
I have the following situation... In a certain View, the user must select the initial hour, the final hour and the weekday. But, I can't save this informations to DB 'cause I need to save my whole page and I need the primary key of the primary…

André Miranda
- 6,420
- 20
- 70
- 94
9
votes
1 answer
TabView does not preserve state when swiping from one tab to another
Context: Here's page that has a TabView to navigate between tabs all of these tabs are making use of flutter_bloc (version 6.0.1).
Problem: When swiping to to any tab, the state is not being preserved and the entire widget tree is being rebuilt as…

Waleed Alrashed
- 777
- 1
- 7
- 20
9
votes
1 answer
Multi bloc builder
here is the situation -
my flutter app dashboard screen has two separate list
pageView on top and
List item
i have a bloc named dashboard_bloc and dashboard_event with two separate event to get pageView data and list item data respectively and…

avinash
- 501
- 2
- 8
- 16
9
votes
1 answer
Persist Provider data across multiple pages not working
I'm using Provider in my flutter app, and when I go to a new page, the data provided to the Provider at page 1 is not accessible in page 2.
The way I understood the way Provider works, was that there is a central place where one stores all the data,…

Jessica
- 9,379
- 14
- 65
- 136
9
votes
2 answers
Is it bad to commit mutations without using actions in Vuex?
I have been using Vuex for awhile now, and I have always been following the pattern: Components use Actions to commit Mutations to mutate the Store. I thought this was the proper way to do things considering this diagram from the docs:
I came…

Henkers
- 209
- 1
- 7
8
votes
3 answers
How to properly install a Pinia Store?
I'm building a Vue 3 app using the OptionsAPI along with a Pinia Store but I frequently run into an issue stating that I'm trying to access the store before createPinia() is called.
I've been following the documentation to use the Pinia store…

IvanS95
- 5,364
- 4
- 24
- 62
8
votes
1 answer
Error: [MobX] Cannot apply 'observable' to 'Store@user': Field not found
I have a Store:
class Store {
user!: User;
constructor() {
makeObservable(this, {
user: observable,
setUser: action
});
}
setUser = (user: User | undefined) => this.user = user;
}
And I'm getting this error:
Error:…

gran33
- 12,421
- 9
- 48
- 76
7
votes
2 answers
What is the best way to update my react state when data in database changes?
I am workin on a project with React and I need to update react state with react hook when new data is inserted to my database. I am using contextAPI but as far as I am concerned, the way my components are structured I can't update that state with…

Nyi Nyi Hmue Aung
- 587
- 1
- 7
- 19