AppStateManager mixin

Менеджер состояния приложения, реализующий ChangeNotifier.

Отвечает за хранение и обновление текущего состояния приложения, а также за обработку исключений и изменение состояния на основе возникших ошибок. Уведомляет слушателей об изменениях состояния.

Superclass constraints

Properties

exceptionService ExceptionService
Сервис для логирования и обработки исключений.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state AppState
Геттер для получения текущего состояния.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Освобождает ресурсы и устанавливает флаг _mounted в false, чтобы предотвратить дальнейшие обновления.
override
handleException<T>({required Object error, StackTrace? stackTrace, T onAuthError(ApiException)?, T onBadRequestError(ApiException)?, T onTimeoutError(ApiException)?, T onOtherError(Object)?}) → void
Логирует исключение и вызывает соответствующий callback в зависимости от его типа.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setState(AppState state) → void
Устанавливает новое состояние приложения и уведомляет слушателей об изменении.
setStateByException(Object error) → void
Обновляет состояние приложения на основе возникшего исключения.
setStateSilent(AppState state) → void
Устанавливает новое состояние без уведомления слушателей.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited