MSHCheckbox class
A circular checkbox which nicely animates changes to its value.
The checkbox itself does not maintain its value as state. Instead, when the state of the checkbox should change, the widget calls the onChanged callback. Most widgets that use this checkbox will listen for the onChanged callback and rebuild the checkbox with a new value to update the visual appearance of the checkbox.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MSHCheckbox
Constructors
- MSHCheckbox({Key? key, required bool value, bool isDisabled = false, @Deprecated("Use MSHColorConfig.fromCheckedUncheckedDisabled instead.") Color? checkedColor, @Deprecated("Use MSHColorConfig.fromCheckedUncheckedDisabled instead.") Color uncheckedColor = const Color(0xFFCCCCCC), @Deprecated("Use MSHColorConfig.fromCheckedUncheckedDisabled instead.") Color disabledColor = const Color(0xFFCCCCCC), MSHColorConfig? colorConfig, double size = 18, Duration? duration, MSHCheckboxStyle style = MSHCheckboxStyle.stroke, required void onChanged(bool selected)})
- Creates an MSHCheckbox.
Properties
- checkedColor → Color?
-
The color of the checkbox when value is
true
. If colorConfig is specified, this value will be overridden byMSHColorConfig.onFillColor
.final - colorConfig → MSHColorConfig
-
The color configuration of the checkbox.
final
- disabledColor → Color
-
The color of the checkbox when isDisabled is
true
. If colorConfig is specified, this value will be overridden byMSHColorConfig.disabledTintColor
, orMSHColorConfig.disabledFillColor
, depending on the style.final - duration → Duration?
-
The duration of the animation which plays when value changes.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisabled → bool
-
Whether the checkbox is disabled.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onChanged → void Function(bool selected)
-
Called when the value of the checkbox should change.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → double
-
The height and width of the checkbox.
final
- style → MSHCheckboxStyle
-
The style of the animation and the check.
final
- uncheckedColor → Color
-
The color of the checkbox when value is
false
. If colorConfig is specified, this value will be overridden byMSHColorConfig.offTintColor
.final - value → bool
-
Whether this checkbox is checked.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MSHCheckbox> -
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}) → 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