QueuedMutation class

A persisted mutation entry stored in the offline queue waiting to be synced with the server.

Encapsulates the unique mutation id, mutationType, serializable payload, creation timestamp createdAt, conflictPolicy, and retryCount.

Example:

final mutation = QueuedMutation(
  id: 'mut_12345',
  mutationType: 'create_comment',
  payload: {'text': 'Great article!'},
  createdAt: DateTime.now(),
);

Constructors

QueuedMutation({required String id, required String mutationType, required Map<String, dynamic> payload, required DateTime createdAt, ConflictPolicy conflictPolicy = ConflictPolicy.clientWins, int retryCount = 0})
Creates a QueuedMutation entry.
QueuedMutation.fromMap(Map<String, dynamic> map)
Deserializes a QueuedMutation from a map.
factory

Properties

conflictPolicy ConflictPolicy
Conflict resolution policy applied if replaying fails.
final
createdAt DateTime
Timestamp when this mutation was enqueued.
final
hashCode int
The hash code for this object.
no setterinherited
id String
Unique mutation identifier.
final
mutationType String
Identifier representing the type/action of mutation (e.g. 'create_post').
final
payload Map<String, dynamic>
Serialized payload data for this mutation.
getter/setter pair
retryCount int
Number of replay attempts already made.
getter/setter pair
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
toMap() Map<String, dynamic>
Serializes this mutation entry to a JSON-compatible map.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited