FocusableControl class
Unstyled focus, hover, validation, and activation behavior for controls.
The builder owns the entire appearance. Available to widget libraries through
package:fleury/fleury_widget_support.dart.
Enter or Space activates (onActivate) when enabled. The builder gets
the fully resolved style and active style states for the control.
Enter arrives as a KeyEvent; Space arrives as inserted text, so the
control claims text input and consumes a single space (declining all
other text so it still bubbles).
- Inheritance
-
- Object
- Widget
- StatefulWidget
- FocusableControl
- Available extensions
Constructors
-
FocusableControl({Key? key, required void onActivate()?, void onSecondaryActivate()?, required Widget builder(CellStyle style, bool enabled, Set<
CellStyleState> states), required SemanticRole semanticRole, required CellStyle defaultStyle, String? semanticLabel, Object? semanticValue, bool? semanticChecked, bool semanticSelected = false, bool styleSelected = false, SemanticSetValueCallback? onSetValue, FocusNode? focusNode, bool autofocus = false, bool participatesInForm = false, String? validationError, CellStyle? style}) -
const
Properties
- autofocus → bool
-
final
-
builder
→ Widget Function(CellStyle style, bool enabled, Set<
CellStyleState> states) -
final
- defaultStyle → CellStyle
-
final
- enabled → bool
-
no setter
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
finalinherited
- onActivate → void Function()?
-
Activation — Enter, Space, a click, or a semantic
activate. Nothing waits on work it starts, a semantic activation included: an error from that work reaches the zone (runApp's error overlay), as a key's does. Throwing SemanticActionDeclined declines the activation: a key or a click then does nothing, and a semantic activation reports itunsupported. Anything else it throws reports that activationfailed.final - onSecondaryActivate → void Function()?
-
final
- onSetValue → SemanticSetValueCallback?
-
When non-null, the control advertises SemanticAction.setValue and routes
the payload here — letting an agent set the value directly (idempotent),
instead of toggling via onActivate and hoping it lands.
final
- participatesInForm → bool
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticChecked → bool?
-
final
- semanticLabel → String?
-
final
- semanticRole → SemanticRole
-
final
- semanticSelected → bool
-
final
- semanticValue → Object?
-
final
- style → CellStyle?
-
final
- styleSelected → bool
-
final
- validationError → String?
-
final
Methods
-
animate(
{Duration? duration, Curve? curve, Object? trigger, bool repeat = false}) → Animate -
Available on Widget, provided by the AnimateExtension extension
Starts an Animate chain over this widget.duration/curveapply to the whole chain. With notriggerit plays on mount; with a non-null trigger it rests on mount and replays whenever the token changes. -
createElement(
) → StatefulElement -
Creates the Element that will mount this widget into the tree.
inherited
-
createState(
) → State< FocusableControl> -
Creates the mutable state for this widget at the current location in
the tree. Called exactly once per StatefulElement instance.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited