SettingsStore class
Typed, namespaced access to persisted app settings over a KeyValueStore.
Holds non-secret preferences (theme, last Hub, last principal) plus, when
the user opts in, the bearer token per Hub. Tokens are stored in
localStorage and are therefore exposed to any script that runs on the
page — see the README security note; rememberToken lets the user keep the
token in memory only.
Constructors
- SettingsStore(KeyValueStore _kv, {String prefix = defaultPrefix})
-
Creates a settings store over
kv, namespacing keys underprefix.
Properties
- aiApiKey ↔ String?
-
The user's own API key, or
nullto use the Hub's key.getter/setter pair - aiLanguage ↔ String?
-
The reply-language preference, or
nullfor the model default.getter/setter pair - aiMode ↔ String?
-
The default agent mode token (
standard/plan/auto), ornull.getter/setter pair - aiModel ↔ String?
-
The user's custom model id, or
null.getter/setter pair - aiProvider ↔ String?
-
The user's custom AI provider token (
anthropic/openai/gemini), ornullto fall back to the Hub default.getter/setter pair - aiUseHubDefault ↔ bool
-
Whether to use the Hub's default AI provider/model (key injected Hub-side).
Defaults to
truewhen never set.getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- hub ↔ String?
-
The last Hub URL used.
getter/setter pair
- prefix → String
-
The namespace every key of this store is written under.
final
- principal ↔ String?
-
The last principal (login name) used.
getter/setter pair
- rememberToken ↔ bool
-
Whether the user opted to persist their token across reloads.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- terminalCustomCols ↔ int?
-
The persisted custom column count, or
null.getter/setter pair - terminalCustomRows ↔ int?
-
The persisted custom row count, or
null.getter/setter pair - terminalDimPreset ↔ String?
-
The persisted terminal dimension preset name, or
null.getter/setter pair - terminalTextSize ↔ String?
-
The persisted terminal text-size preference, or
null.getter/setter pair - theme ↔ String?
-
The persisted theme preference (
light,dark, orsystem), ornull.getter/setter pair
Methods
-
clearAllTokens(
) → void - Removes every persisted token (used on "forget all").
-
clearToken(
String hubUri) → void -
Removes the saved token for
hubUri. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveToken(
String hubUri, String token) → void -
Persists
tokenforhubUri. -
tokenFor(
String hubUri) → String? -
Reads the saved token for
hubUri, ornullif none was persisted. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultPrefix → const String
- The default key namespace.