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:

Inheritance

Constructors

SetComponentLoading({required String key, required bool isLoading})
Creates a SetComponentLoading event.
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
isLoading → bool
Whether the loading indicator should be shown or hidden.
final
key → String
Unique identifier for the loading operation.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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