toMap method
Convert command to a map for serialization.
Override in subclasses to include command-specific data. This is used by the saga command queue codec, so it is part of the public surface.
Implementation
Map<String, dynamic> toMap() {
return {
'commandId': _commandId,
'timestamp': timestamp.toIso8601String(),
'metadata': persistableMetadataOf(metadata),
'type': typeName,
};
}