SettingsHost class abstract

The port between the panes and a settings object they must not name.

Every member here was read off a call site, not designed. The three panes were typed on the subject's own settings class, and what they actually did with it was: walk the spec, read a switch, write a switch, build one control, and — in one place — draw something no registry entry could express. Five operations, so five members. A sixth would be a guess.

The panes are rebuilt whenever the settings change, so an implementation is an ordinary short-lived value wrapping the current settings and the callback that replaces them. It is not a store and holds no state of its own.

Prior art in this repository: RowLocator, which is how the drag-selection controller asks "which row is at this offset" without knowing the body, and ShellDestinations, which is how the shell receives a menu it cannot name.

Constructors

SettingsHost()

Properties

activePresetId → String?
The preset the current settings still match, or null once anything has been changed by hand.
no setter
hashCode → int
The hash code for this object.
no setterinherited
presets → List<PresetSummary>
The named combinations this host offers, in the order to show them.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spec → List<SettingGroup>
Every group, in the order the panel shows them.
no setter

Methods

applyPreset(String presetId) → void
Applies one, by id.
control(String settingId) → SettingsControl
The control for one setting id.
extrasAfterOptions(String featureId, BuildContext context) → List<Widget>
Widgets drawn after this feature's options. See extrasBeforeOptions.
extrasBeforeOptions(String featureId, BuildContext context) → List<Widget>
Widgets the registry cannot express, drawn before this feature's options.
isOn(String switchId) → bool
Whether the switch with this id is on.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setSwitch(String switchId, bool on) → void
Turns that switch on or off.
toString() → String
A string representation of this object.
inherited

Operators

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