InMemoryCardStateStore class

A simple, thread-safe, in-memory implementation of CardStateStore.

Intended solely for unit testing and demo code. Do not use for production persistence.

Implemented types

Constructors

InMemoryCardStateStore()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store Map<String, SRSCardState>
Returns an unmodifiable view of the underlying map store.
no setter

Methods

clear() → void
Clears all card states in the store.
deleteCardState(String cardId) Future<void>
Deletes the persistent card state for cardId.
override
getCardsByIds(List<String> cardIds) Future<List<SRSCardState>>
Loads card states matching the list of cardIds, maintaining order where possible.
override
getCardState(String cardId) Future<SRSCardState?>
Loads the scheduling state for a card by cardId, or returns null if not found.
override
getDueCards(DateTime now) Future<List<SRSCardState>>
Retrieves all cards whose review dueDate is at or before now (excluding new cards).
override
getNewCards(int limit) Future<List<SRSCardState>>
Retrieves up to limit cards in the newCard phase.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
saveCardState(SRSCardState state) Future<void>
Saves or updates the scheduling state for a single card.
override
saveCardStates(List<SRSCardState> states) Future<void>
Saves or updates the scheduling states for multiple cards in bulk.
override
seed(List<SRSCardState> states) → void
Pre-seeds the store with a list of card states.
toString() String
A string representation of this object.
inherited

Operators

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