SetComponentLoading class
Event to control loading state for a specific component or operation.
This event is used to show or hide loading indicators across the application. Each loading operation can be identified by a unique key, allowing multiple independent loading states to be managed simultaneously.
Example:
// Show loading for login operation
commonBloc.add(SetComponentLoading(
key: 'login',
isLoading: true,
));
// Hide loading after operation completes
commonBloc.add(SetComponentLoading(
key: 'login',
isLoading: false,
));
// Use global loading state
commonBloc.add(SetComponentLoading(
key: LoadingKey.global,
isLoading: true,
));
See also:
- CommonBloc for handling this event
- CommonState for the resulting state
- LoadingKey for predefined loading keys
- Inheritance
-
- Object
- MainBlocEvent
- CommonEvent
- SetComponentLoading
Constructors
- SetComponentLoading({required String key, required bool isLoading})
-
Creates a SetComponentLoading event.
const
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited