Fluent2Checkbox class
Fluent 2's Checkbox: the box (16, its corner 2;
Fluent2CheckboxShape.circular a disc; Fluent2CheckboxSize.large 20) 8 in
from its edges, its label 4 beside it in body1, the whole row one
checkbox. Unchecked it is the accessible stroke with the label in the third
ink; checked the brand fill (compoundBrandBackground) with the white check
and the label in the first ink; a null value is mixed, the brand stroke
round the brand square. A press, or Space, asks onChanged for the other
state (mixed goes to checked); null onChanged draws it disabled.
style restyles the box over Fluent2ThemeData.checkboxTheme, in its
states (selected while checked, hovered, pressed, disabled): fill,
foreground (the mark), edge, side, shape, minimumSize (the
box's side), iconSize (the mark's) and textStyle (the label's). The
box takes Fluent's small corner, at most a quarter of its side.
Fluent2Checkbox(value: notify, label: 'Email me when files change', onChanged: (v) => setState(() => notify = v))
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Fluent2Checkbox
Constructors
-
Fluent2Checkbox({required bool? value, required ValueChanged<
bool> ? onChanged, String? label, String? semanticLabel, Fluent2CheckboxShape shape = Fluent2CheckboxShape.square, Fluent2CheckboxSize size = Fluent2CheckboxSize.medium, Fluent2LabelPosition labelPosition = Fluent2LabelPosition.after, Fluent2Style? style, FocusNode? focusNode, bool autofocus = false, Key? key}) -
A check box holding
value.const
Properties
- autofocus → bool
-
Whether the control takes focus when it first builds.
final
- focusNode → FocusNode?
-
The control's focus node; null makes and disposes its own.
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?
-
The words beside the box.
final
- labelPosition → Fluent2LabelPosition
-
Fluent2LabelPosition.before or Fluent2LabelPosition.after
(Fluent's checkbox has no other; above and below are refused).
final
-
onChanged
→ ValueChanged<
bool> ? -
Called with the new state when the user changes it; null puts it out of
use.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
What a screen reader says; null says label.
final
- shape → Fluent2CheckboxShape
-
Fluent's
shape: square or circular.final - size → Fluent2CheckboxSize
-
Fluent's
size: medium or large.final - style → Fluent2Style?
-
This box's own look, slot by slot, over the checkbox theme.
final
- value → bool?
-
Checked, unchecked, or null for mixed.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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.
override
-
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