OudsCheckbox class

OUDS Checkbox design guidelines

Checkboxes are input controls that allow users to select one or more options from a number of choices.

This checkbox supports the indeterminate state: Checkboxes can have a parent-child relationship with other checkboxes. When the parent checkbox is checked, all child checkboxes are checked. If a parent checkbox is unchecked, all child checkboxes are unchecked. If some, but not all, child checkboxes are checked, the parent checkbox becomes an indeterminate checkbox.

The following parameters are available:

  • value: Controls checked state of the checkbox.
  • onChanged: Callback invoked on checkbox click. If null, then this is passive and relies entirely on a higher-level component to control the checked state.
  • tristate: If true, the checkboxes value can be true, false, or null. If false, only true and false states are managed.
  • isError: Controls the error state of the checkbox.

You can use OudsCheckbox like this :

Enabled checkbox sample :

The status of the checkbox before a user has interacted with it, or other content affects it.

OudsCheckbox(
  value: isChecked,
  onChanged: (bool? newValue) {
     setState(() {
        isCheckedFirst = newValue;
      });
    },
  isError: false,
);
Inheritance

Constructors

OudsCheckbox.new({Key? key, required bool? value, required ValueChanged<bool?>? onChanged, bool isError = false, bool tristate = false})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
isError bool
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged ValueChanged<bool?>?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tristate bool
final
value bool?
final

Methods

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