WidgetSpec class final

The declaration of one widget type.

Annotations
  • @immutable

Constructors

WidgetSpec(String type, {required List<PropDef<Object?>> props, ChildModel children = ChildModel.none, List<String> slots = const [], bool decorated = false, List<PropDef<Object?>> childFields = const [], ChildFitRule? childFits, String doc = '', List<EventSpec> events = const [], List<String> states = const [], bool hugs = false, bool fillsWidth = false})
const

Properties

childFields → List<PropDef<Object?>>
What this widget reads from each child's layout to place it: Flutter's parent data (Positioned in a stack, Flexible/Align in a flex). The fields are LayoutFields; a child's panel shows them as its placement, chosen by its parent.
final
childFits → ChildFitRule?
Which size fits a child may take (null: defaultChildFits); see childFitOptions.
final
children → ChildModel
final
decorated → bool
Has a box decoration (fills, strokes, radius, effects).
final
doc → String
final
events → List<EventSpec>
The events it fires (a component's widget.events): what a call's {"type": "event", "event": "<key>"} reactions handle. Empty for the core's widgets, whose events are triggers.
final
fillsWidth → bool
With no width written it fills its parent's, and with no height it hugs (a progress bar, a list tile, a table, a chart): complete with nothing written, like a control that hugs.
final
hashCode → int
The hash code for this object.
no setterinherited
hugs → bool
A control (a button, a chip, a spinner): a node of it that gives no layout.width or layout.height hugs its content on that axis (the default control's size) instead of being 0 (zero_size).
final
props → List<PropDef<Object?>>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slots → List<String>
Named slots this widget takes (body, leading...).
final
states → List<String>
The WidgetStates (by name: hovered, focused, pressed, selected, disabled) its own look draws with nothing styled, as a Flutter button's default ButtonStyle resolves them: a bound selected on it shows without a states.selected patch.
final
type → String
The node type.
final

Methods

event(String key) → EventSpec?
The event key, or null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prop(String key) → PropDef<Object?>?
toString() → String
A string representation of this object.
inherited

Operators

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