JsonSwitchBuilder class

Builder that can build an Switch widget. See the fromDynamic for the format.

Inheritance

Constructors

JsonSwitchBuilder({Color? activeColor, ImageProvider<Object>? activeThumbImage, Color? activeTrackColor, required bool autofocus, AutovalidateMode? autovalidateMode, required DragStartBehavior dragStartBehavior, required bool enabled, Color? focusColor, FocusNode? focusNode, Color? hoverColor, Color? inactiveThumbColor, ImageProvider<Object>? inactiveThumbImage, Color? inactiveTrackColor, String? label, MaterialTapTargetSize? materialTapTargetSize, MouseCursor? mouseCursor, ImageErrorListener? onActiveThumbImageError, ValueChanged<bool>? onChanged, ImageErrorListener? onInactiveThumbImageError, ValueChanged<bool?>? onSaved, MaterialStateProperty<Color?>? overlayColor, double? splashRadius, MaterialStateProperty<Color?>? thumbColor, MaterialStateProperty<Color?>? trackColor, Validator? validator, bool? value, VisualDensity? visualDensity})

Properties

activeColor → Color?
final
activeThumbImage → ImageProvider<Object>?
final
activeTrackColor → Color?
final
autofocus → bool
final
autovalidateMode → AutovalidateMode?
final
dragStartBehavior → DragStartBehavior
final
enabled → bool
final
focusColor → Color?
final
focusNode → FocusNode?
final
hashCode → int
The hash code for this object.
no setterinherited
hoverColor → Color?
final
inactiveThumbColor → Color?
final
inactiveThumbImage → ImageProvider<Object>?
final
inactiveTrackColor → Color?
final
label → String?
final
materialTapTargetSize → MaterialTapTargetSize?
final
mouseCursor → MouseCursor?
final
numSupportedChildren → int
finalinherited
onActiveThumbImageError → ImageErrorListener?
final
onChanged → ValueChanged<bool>?
final
onInactiveThumbImageError → ImageErrorListener?
final
onSaved → ValueChanged<bool?>?
final
overlayColor → MaterialStateProperty<Color?>?
final
preferredSizeWidget → bool
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
splashRadius → double?
final
thumbColor → MaterialStateProperty<Color?>?
final
trackColor → MaterialStateProperty<Color?>?
final
validator → Validator?
final
value → bool?
final
visualDensity → VisualDensity?
final

Methods

build({required ChildWidgetBuilder? childBuilder, required BuildContext context, required JsonWidgetData data}) → Widget
Builds the widget. If there are dynamic keys on the data object, and the widget is not a PreferredSizeWidget, then the returned widget will be wrapped by a stateful widget that will rebuild if any of the dynamic args change in value.
inherited
buildCustom({ChildWidgetBuilder? childBuilder, required BuildContext context, required JsonWidgetData data, Key? key}) → Widget
Builds the widget to render to the tree. If the data object has a non-empty id associated with it and the enabled property is true then this will attach the selected value to the JsonWidgetRegistry using the id as the key any time the selected value is changed.
override
getChild(JsonWidgetData? data, {int index = 0}) → JsonWidgetData
Returns a non-null child for widgets that must always have child widgets. This allows the widget to be built and rendered even if the child is missing.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
remove(JsonWidgetData data) → void
Removes any / all values this builder may have set from the JsonWidgetRegistry.
override
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

fromDynamic(dynamic map, {JsonWidgetRegistry? registry}) → JsonSwitchBuilder?
Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:

Constants

kNumSupportedChildren → const int
type → const String