mirror of
https://github.com/hanskokx/arcane_framework.git
synced 2026-05-14 02:19:08 +02:00
Remove unnecessary notifyListeners calls
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
@@ -20,8 +20,6 @@ class FavoriteColorService extends ArcaneService {
|
||||
if (_notifier.value != newValue) {
|
||||
_notifier.value = newValue;
|
||||
}
|
||||
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user