Remove unnecessary notifyListeners calls

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2025-05-14 11:11:45 +02:00
parent 7bf5a6d33d
commit 55ff65ba32
3 changed files with 5 additions and 13 deletions
@@ -67,7 +67,6 @@ class ArcaneAuthenticationService extends ArcaneService {
_notifier.value = AuthenticationStatus.unauthenticated;
_isSignedIn.value = isAuthenticated;
_previousModeWhenSettingDebug = null;
notifyListeners();
}
/// Registers an `ArcaneAuthInterface` within the `ArcaneAuthenticationService`.
@@ -157,7 +156,6 @@ class ArcaneAuthenticationService extends ArcaneService {
_notifier.value = newStatus;
_isSignedIn.value = isAuthenticated;
}
notifyListeners();
}
/// Logs the current user out. Upon successful logout, `status` will be set to
@@ -82,7 +82,6 @@ class ArcaneFeatureFlags extends ArcaneService {
);
}
notifyListeners();
return I;
}
@@ -111,7 +110,6 @@ class ArcaneFeatureFlags extends ArcaneService {
);
}
notifyListeners();
return I;
}
@@ -121,12 +119,9 @@ class ArcaneFeatureFlags extends ArcaneService {
/// It is called automatically when enabling or disabling features if they haven't
/// already been initialized.
void _init() {
_notifier.value = [];
notifier.addListener(_listener);
if (I._initialized) return;
reset();
I._initialized = true;
notifyListeners();
}
/// Resets the feature flags to their initial state.
@@ -134,10 +129,11 @@ class ArcaneFeatureFlags extends ArcaneService {
/// This method clears all enabled features, resets notification values,
/// marks the flags as uninitialized, and notifies listeners of the changes.
void reset() {
notifier
..removeListener(_listener)
..addListener(_listener);
_notifier.value = [];
I._initialized = false;
notifyListeners();
}
void _listener() {