MessageState class
Represents the various states a message can be in.
- Implementers
- Available Extensions
- Annotations
-
- @freezed
Constructors
- MessageState.completed({required CompletedState state})
-
Completed state when the message has been successfully sent, updated, or
deleted.
constfactory
- MessageState.deleted({required bool hard})
-
Deleting state when the message has been successfully deleted.
factory
- MessageState.deleting({required bool hard})
-
Deleting state when the message is being deleted.
factory
- MessageState.deletingFailed({required bool hard})
-
Deleting failed state when the message fails to be deleted.
factory
- MessageState.failed({required FailedState state, Object? reason})
-
Failed state when the message fails to be sent, updated, or deleted.
constfactory
-
MessageState.fromJson(Map<
String, dynamic> json) -
Creates a new instance from a json
factory
- MessageState.initial()
-
Initial state when the message is created.
constfactory
- MessageState.outgoing({required OutgoingState state})
-
Outgoing state when the message is being sent, updated, or deleted.
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult initial(MessageInitial value), required TResult outgoing(MessageOutgoing value), required TResult completed(MessageCompleted value), required TResult failed(MessageFailed value)}) → TResult -
inherited
-
mapOrNull<
TResult extends Object?> ({TResult? initial(MessageInitial value)?, TResult? outgoing(MessageOutgoing value)?, TResult? completed(MessageCompleted value)?, TResult? failed(MessageFailed value)?}) → TResult? -
inherited
-
maybeMap<
TResult extends Object?> ({TResult initial(MessageInitial value)?, TResult outgoing(MessageOutgoing value)?, TResult completed(MessageCompleted value)?, TResult failed(MessageFailed value)?, required TResult orElse()}) → TResult -
inherited
-
maybeWhen<
TResult extends Object?> ({TResult initial()?, TResult outgoing(OutgoingState state)?, TResult completed(CompletedState state)?, TResult failed(FailedState state, Object? reason)?, required TResult orElse()}) → TResult -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult initial(), required TResult outgoing(OutgoingState state), required TResult completed(CompletedState state), required TResult failed(FailedState state, Object? reason)}) → TResult -
inherited
-
whenOrNull<
TResult extends Object?> ({TResult? initial()?, TResult? outgoing(OutgoingState state)?, TResult? completed(CompletedState state)?, TResult? failed(FailedState state, Object? reason)?}) → TResult? -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- hardDeleted → const MessageState
- Hard deleted state when the message has been successfully hard deleted.
- hardDeleting → const MessageState
- Hard deleting state when the message is being hard deleted.
- hardDeletingFailed → const MessageState
- Hard deleting failed state when the message fails to be hard deleted.
- sending → const MessageState
- Sending state when the message is being sent.
- sendingFailed → const MessageState
- Sending failed state when the message fails to be sent.
- sent → const MessageState
- Sent state when the message has been successfully sent.
- softDeleted → const MessageState
- Deleted state when the message has been successfully soft deleted.
- softDeleting → const MessageState
- Deleting state when the message is being soft deleted.
- softDeletingFailed → const MessageState
- Deleting failed state when the message fails to be soft deleted.
- updated → const MessageState
- Updated state when the message has been successfully updated.
- updating → const MessageState
- Updating state when the message is being updated.
- updatingFailed → const MessageState
- Updating failed state when the message fails to be updated.