InMemoryTokenStorage class

A simple, isolate-local TokenStorage backed by a single field.

Useful for tests and short-lived processes. Not durable; tokens are lost when the process exits.

Implemented types

Constructors

InMemoryTokenStorage({Token? initial})
Creates an empty storage. Pass initial to seed it.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
snapshot Token?
Synchronous peek at the currently-stored token.
no setter

Methods

clone() InMemoryTokenStorage
Returns a new InMemoryTokenStorage seeded with the same token.
delete() Future<void>
Removes any stored token. A no-op if storage is empty.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read() Future<Token?>
Returns the stored token or null if none was written.
override
toString() String
A string representation of this object.
inherited
write(Token token) Future<void>
Persists token, replacing any previous entry.
override

Operators

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