PromptStash class

In-memory stack of stashed drafts (newest last).

Constructors

PromptStash({int maxEntries = 50, DateTime clock()?})

Properties

entries List<PromptStashEntry>
no setter
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
no setter
length int
no setter
maxEntries int
final
newest PromptStashEntry?
Peek newest without removing.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pop() PromptStashEntry?
Pop the newest entry, or null if empty.
push(String input, {String? label, DateTime? timestamp}) PromptStashEntry?
Push a draft. Empty input is ignored.
removeAt(int index) PromptStashEntry?
Remove by index (0 = oldest).
toString() String
A string representation of this object.
inherited

Operators

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