CheckboxUic class

Enhanced checkbox widget, that maintain its state, has a title and can show additional description in each state.

CheckboxUic is an original Checkbox widget, composed with a title and optional description text. For unchecked state it also allows to set individual titleUnchecked and descriptionUnchecked values.

For description, instead of just a text, you can pass your custom views in descriptionView and descriptionViewUnchecked parameters.

This widget, unlike the original Checkbox, maintain its own state (checked or unchecked). You can set the initial state with initialValue parameter.

All original Checkbox parameters are supported.

When the state is changed, the onChanged callback is called with updated state. If the onChanged isn't, the CheckboxUic is disabled.

See also:

Inheritance

Constructors

CheckboxUic({Key? key, bool initialValue = false, String title = '', String? titleUnchecked, TextStyle? titleTextStyle, String? description, String? descriptionUnchecked, TextStyle? descriptionTextStyle, Widget? descriptionView, Widget? descriptionViewUnchecked, bool tristate = false, ValueChanged<bool?>? onChanged, Color? activeColor, Color? checkColor, Color? focusColor, Color? hoverColor, MaterialTapTargetSize? materialTapTargetSize, FocusNode? focusNode, bool autofocus = false})
const

Properties

activeColor Color?
final
autofocus bool
final
checkColor Color?
final
description String?
Optional description text
final
descriptionTextStyle TextStyle?
Style of description text
final
descriptionUnchecked String?
Optional description text for unchecked state
final
descriptionView Widget?
Widget to display in the description area
final
descriptionViewUnchecked Widget?
Widget to display in the description area for unchecked state
final
focusColor Color?
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
hoverColor Color?
final
initialValue bool
Initial state of the checkbox
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
materialTapTargetSize MaterialTapTargetSize?
final
onChanged ValueChanged<bool?>?
A callback function that is called when the check box state is changed
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String
Title text to display near the checkbox
final
titleTextStyle TextStyle?
Style of the title text
final
titleUnchecked String?
Optional title text for unchecked state
final
tristate bool
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _CheckboxUicState
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