CommonState class

Represents the state of common application-wide features.

This state manages loading indicators across the application using a key-based system. Each loading operation can have its own unique key, allowing multiple loading states to be tracked independently.

Example:

// Check global loading state
final isGlobalLoading = state.isLoading();

// Check specific loading state
final isLoginLoading = state.isLoading(key: 'login');
Inheritance

Constructors

CommonState({Map<String, bool> loadingStates = const {}})
const

Properties

hashCode int
The hash code for this object.
no setteroverride
loadingStates Map<String, bool>
A map of loading states keyed by their unique identifiers.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({Map<String, bool>? loadingStates}) CommonState
Creates a copy of this state with the given fields replaced with new values.
isLoading({String? key = LoadingKey.global}) bool
Checks if a loading operation is currently active.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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