DVStudioSwitch class
A switch: the track and the thumb Studio draws, with the behaviour a switch has to have.
The one in the flags screen was a GestureDetector around an
AnimatedContainer, which is the same picture-of-a-control the buttons were:
Tab skipped it, Space did nothing, and a reader was told the words beside it
and nothing about the thing that turns them on.
builder draws the track and thumb, so a switch that looks different — the debug override's amber track — keeps its own look and this keeps the focus, the keys, the ring and the description.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DVStudioSwitch
Constructors
- DVStudioSwitch({Key? key, required String label, required bool on, VoidCallback? onTap, required Widget builder(BuildContext context, bool on, Color track)})
-
const
Properties
- builder → Widget Function(BuildContext context, bool on, Color track)
-
The track and the thumb, given the colour they should be drawn in.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
What the switch is for, and which way it is set: the name a reader gets is
both, because "on" without a subject is not a name.
final
- on → bool
-
Whether it is on.
final
- onTap → VoidCallback?
-
What turning it does. Null is a switch nobody may turn.
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< DVStudioSwitch> -
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