BoolConfigurable class

A configurable boolean field rendered as a confirm prompt.

In the editor list, shows the current state as true / false. When selected, opens a yes/no confirm prompt to toggle the value.

BoolConfigurable(
  key: 'darkMode',
  label: 'Dark Mode',
  value: true,
)
Inheritance

Constructors

BoolConfigurable({required String key, required String label, bool value = false, String? description, String? hint, String formatter(bool value)?, String? validator(bool value)?, String? icon, String trueLabel = 'Yes', String falseLabel = 'No'})
Creates a boolean configurable field.

Properties

defaultTypeIcon → String
The default icon for this configurable type. Override in subclasses to provide a type-specific glyph.
no setteroverride
defaultValue → bool
The original value before any edits.
finalinherited
description → String?
Optional longer description shown as context when editing.
finalinherited
displayValue → String
Formatted string representation of value for display in the list.
no setterinherited
falseLabel → String
Label shown for the "false" option in the confirm prompt.
final
formatter → String Function(bool value)?
Optional display formatter. When provided, displayValue uses this instead of the default toString() representation.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
hint → String?
Optional hint text shown alongside the field.
finalinherited
icon → String?
Custom icon override. When set, typeIcon returns this instead of the subclass default from defaultTypeIcon.
finalinherited
isModified → bool
Whether the current value differs from defaultValue.
no setterinherited
key → String
Unique key used for serialization and lookup.
finalinherited
label → String
Human-readable label shown in the editor list.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
trueLabel → String
Label shown for the "true" option in the confirm prompt.
final
typeIcon → String
Glyph prefix identifying the field type in the list view. Returns the custom icon if set, otherwise defaultTypeIcon.
no setterinherited
validator → String? Function(bool value)?
Optional validator. Returns an error message on failure, null on success. Returning '' is also accepted as success for backwards compatibility.
finalinherited
value ↔ bool
The current value of this configurable.
getter/setter pairinherited

Methods

edit(Terminice terminice) → bool
Runs the appropriate terminice prompt to edit this field's value.
override
formatValue() → String
Override in subclasses to provide type-specific formatting.
override
loadJsonValue(dynamic jsonValue) → void
Deserializes and applies a value from a JSON-compatible source.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets value back to defaultValue.
inherited
toJsonValue() → dynamic
Serializes the current value into a JSON-compatible map entry.
override
toString() → String
A string representation of this object.
inherited
trySetValue(bool candidate) → bool
Sets value to candidate only when it passes validation.
inherited
validate() → String?
Validates the current value. Returns null if valid, error message otherwise.
inherited
validationErrorFor(bool candidate) → String?
Validates a candidate value using the shared validator semantics.
inherited

Operators

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