InMemorySessionStore class final

In-memory implementation of persistent session store.

Implemented types
Annotations
  • @experimental

Constructors

InMemorySessionStore({bool rejectBranchingSessions = false})
Creates an in-memory store.

Properties

hashCode int
The hash code for this object.
no setterinherited
rejectBranchingSessions bool
Whether a branched sessionId lookup is rejected instead of resolving to the most-recent leaf.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getLatestSnapshotMetadata(String sessionId, {Map<String, dynamic>? context}) Future<SessionSnapshot?>
SessionStore.getSnapshot by sessionId (the session's latest leaf) without the state: the same resolution, the same null-if-none contract, and a row with state null. The resolved sessionId is carried on the returned row even for a row that stored it only under state.
override
getSnapshot({String? snapshotId, String? sessionId, Map<String, dynamic>? context}) Future<SessionSnapshot?>
Loads a snapshot either by its snapshotId or by sessionId.
override
getSnapshotMetadata(String snapshotId, {Map<String, dynamic>? context}) Future<SessionSnapshot?>
SessionStore.getSnapshot by snapshotId without the state: the returned row carries every other field as stored, with state null, and the same null-if-not-found contract.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onSnapshotStateChange(String snapshotId, void callback(SessionSnapshot snapshot), {Map<String, dynamic>? context}) → void Function()?
Registers callback for state changes to snapshotId. Returns an unsubscribe function, or null if not supported.
override
saveSnapshot(String? snapshotId, SnapshotMutator mutator, {Map<String, dynamic>? context}) Future<String?>
Atomically reads the current snapshot (if snapshotId is provided), passes it to mutator, and persists the result.
override
toString() String
A string representation of this object.
inherited

Operators

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