You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classExampleextendsAsyncNotifier<int> {
...
voidfn() {
state =AsyncLoading(); // KO, "update" will likely never completeupdate((data) => ...);
}
voidfn() {
update((data) {
state =AsyncLoading(); // OK
...
});
}
voidfn() {
update((unused) => ...); // the parameter should be used. Otherwise use AsyncValue.guard
}
}
The text was updated successfully, but these errors were encountered:
I am trying to update the state of a FamilyAsyncNotifier partially, I just want to know whether I am doing it right. Also in this case of updating a asyncvalue partially, I want to know what's differences in using whenData, AsyncGuard.value and update method . It would be a immense help, if you provide some clarity on this.
Example
The state here is a freezed class and looks something like this
All the above properties are not updated in a one go, for example the below code tries to update the students property while retaining the other values to its previous value.
The text was updated successfully, but these errors were encountered: