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
- isCompleted → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in completed state.no setter - isDeleted → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in completed deleted state.no setter - isDeleting → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in outgoing deleting state.no setter - isDeletingFailed → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in failed deleting state.no setter - isFailed → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in failed state.no setter - isHardDeleted → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in completed hard deleted state.no setter - isHardDeleting → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in outgoing hard deleting state.no setter - isHardDeletingFailed → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in failed hard deleting state.no setter - isInitial → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in initial state.no setter - isOutgoing → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in outgoing state.no setter - isSending → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in outgoing sending state.no setter - isSendingFailed → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in failed sending state.no setter - isSent → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in completed sent state.no setter - isSoftDeleted → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in completed soft deleted state.no setter - isSoftDeleting → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in outgoing soft deleting state.no setter - isSoftDeletingFailed → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in failed soft deleting state.no setter - isUpdated → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in completed updated state.no setter - isUpdating → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in outgoing updating state.no setter - isUpdatingFailed → bool
-
Available on MessageState, provided by the MessageStateX extension
Returns true if the message is in failed updating state.no setter - 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> -
Serializes this MessageState to a JSON map.
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.