DVStudioControl class
A button in Studio: the look of DVStudioStyle.control, and the behaviour a button has to have whatever it is drawn with.
DVStudioStyle.control is a picture -- a box and some words. Every caller
put a GestureDetector around it, which made Studio reachable with a mouse
and nothing else: Tab skipped every button in it, Enter and Space did
nothing, and a screen reader read the words on a control without ever being
told it was one. That is not a gap in Studio's own polish; it is the whole
of what "reachable by keyboard" means.
So the behaviour lives here rather than in each of the thirty-odd call sites, once, for every button in the section it lands in: the focus, the key that presses it, the role a reader is told about, and a ring drawn on the control so the reader can see where they are.
enabled: false is the control that does nothing: it is not focusable, not
announced as a button, and its keys do nothing -- Undo with no history,
Publish while publishing.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DVStudioControl
Constructors
- DVStudioControl({Key? key, required String label, required bool enabled, VoidCallback? onTap, bool primary = false, IconData? icon})
-
const
Properties
- enabled → bool
-
Whether this control does anything. False for an action with nothing to
do, so that it says so rather than looking identical to one that works.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
The glyph before the label.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
What a person reads, and what a reader is told it is.
final
- onTap → VoidCallback?
-
What pressing it does. Null is the same as not enabled.
final
- primary → bool
-
The accented one: the action a panel wants taken.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DVStudioControl> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited