RatingConfigurable class

A configurable star-rating field.

Opens a discrete rating prompt with 1–maxStars stars. Optional labels map each star level to a human-readable label.

RatingConfigurable(
  key: 'priority',
  label: 'Priority',
  value: 3,
  maxStars: 5,
  labels: ['Lowest', 'Low', 'Medium', 'High', 'Critical'],
)
Inheritance

Constructors

RatingConfigurable({required String key, required String label, int value = 3, String? description, String? hint, String formatter(int value)?, String? validator(int value)?, String? icon, int maxStars = 5, List<String>? labels})
Creates a rating configurable field.

Properties

defaultTypeIcon → String
The default icon for this configurable type. Override in subclasses to provide a type-specific glyph.
no setteroverride
defaultValue → int
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
formatter → String Function(int 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
labels → List<String>?
Optional labels for each star level (index 0 = 1 star, etc.).
final
maxStars → int
Maximum number of stars (1-based).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
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(int value)?
Optional validator. Returns an error message on failure, null on success. Returning '' is also accepted as success for backwards compatibility.
finalinherited
value ↔ int
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(int 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(int candidate) → String?
Validates a candidate value using the shared validator semantics.
inherited

Operators

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