UpdateEvent<State> class
A generic event class used to update the state of a BLoC.
The UpdateEvent class provides a convenient way to trigger state updates within a BLoC by encapsulating the new state that should be emitted. While BLoCs can be updated using various event types, using UpdateEvent helps maintain a consistent approach to state updates.
To use UpdateEvent, simply create an instance of the event and provide the new state as a parameter. When dispatched within a BLoC, the state contained in the event will be emitted as the new state.
Example usage:
final updatedState = MyState(/* updated values */);
final updateEvent = UpdateEvent(updatedState);
myBloc.add(updateEvent);
Constructors
- UpdateEvent(State state)
-
Creates an UpdateEvent instance with the specified
state
.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → State
-
The new state that should be emitted by the BLoC.
final
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