StacCheckBox class
A Stac model representing Flutter's Checkbox
widget.
Displays a Material Design checkbox that can toggle between checked and unchecked states. Supports tristate behavior, mouse cursor, colors, and splash radius customizations.
{@tool snippet} Dart Example:
StacCheckBox(
id: 'acceptTerms',
value: false,
onChanged: StacSetValueAction(values: [{'key': 'acceptTerms', 'value': true}]),
activeColor: '#2196F3',
checkColor: '#FFFFFF',
)
{@end-tool}
{@tool snippet} JSON Example:
{
"type": "checkBox",
"id": "acceptTerms",
"value": false,
"onChanged": {"type": "setValue", "key": "acceptTerms"},
"activeColor": "#2196F3",
"checkColor": "#FFFFFF"
}
{@end-tool}
See also:
- Flutter's Checkbox documentation
- Inheritance
-
- Object
- StacElement
- StacWidget
- StacCheckBox
- Annotations
-
- @JsonSerializable(explicitToJson: true)
Constructors
- StacCheckBox.new({String? id, bool? value, bool? tristate, StacAction? onChanged, StacMouseCursor? mouseCursor, StacColor? activeColor, StacColor? fillColor, StacColor? checkColor, StacColor? focusColor, StacColor? hoverColor, StacColor? overlayColor, double? splashRadius, StacMaterialTapTargetSize? materialTapTargetSize, bool? autofocus, bool? isError})
-
Creates a StacCheckBox.
const
-
StacCheckBox.fromJson(Map<
String, dynamic> json) -
Creates a StacCheckBox from a JSON map.
factory
Properties
- activeColor → StacColor?
-
The color to use for the checkbox when it is active.
final
- autofocus → bool?
-
Whether this checkbox should focus itself if nothing else is focused.
final
- checkColor → StacColor?
-
The color of the check icon when the checkbox is checked.
final
- fillColor → StacColor?
-
The fill color of the checkbox.
final
- focusColor → StacColor?
-
The color of the checkbox's focus highlight.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoverColor → StacColor?
-
The color of the checkbox when a pointer is hovering over it.
final
- id → String?
-
Identifier used with form scope to store/read this checkbox's value.
final
- isError → bool?
-
Whether to display the checkbox in an error state.
final
-
jsonData
→ Map<
String, dynamic> ? -
Raw JSON data for this widget
finalinherited
- materialTapTargetSize → StacMaterialTapTargetSize?
-
Configures the minimum size of the area within which the checkbox may be pressed.
final
- mouseCursor → StacMouseCursor?
-
The mouse cursor to use when hovering over this widget.
final
- onChanged → StacAction?
-
Action invoked when the user toggles the checkbox.
final
- overlayColor → StacColor?
-
The overlay color for the checkbox's ink response.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- splashRadius → double?
-
The splash radius of the checkbox's splash in logical pixels.
final
- tristate → bool?
-
Whether this checkbox supports three states (true, false, null).
final
- type → String
-
Widget type identifier.
no setteroverride
- value → bool?
-
Whether this checkbox is checked.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Converts this StacCheckBox instance to a JSON map.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited