CheckBox
| Название типа | Поддерживает анимации свойств | Контроллируемый по умолчанию | Может содержать связанное действие | Ссылка |
|---|---|---|---|---|
| CheckBox | ✗ | ✔️ | ✔️ | link |
к сведению
Значение, хранимое виджетом, может быть использовано в качестве источника данных для действий.
Атрибуты (устаревшие модели)
class CheckboxAttributes extends AttendedModel<bool>
implements DuitAttributes<CheckboxAttributes> {
final bool? autofocus;
final bool? isError;
final bool? tristate;
final String? semanticLabel;
final double? splashRadius;
final BorderSide? side;
final WidgetStateProperty<Color>? fillColor;
final WidgetStateProperty<Color>? overlayColor;
final Color? checkColor;
final Color? splashColor;
final Color? activeColor;
final Color? focusColor;
final Color? hoverColor;
final VisualDensity visualDensity;
CheckboxAttributes({
required super.value,
this.autofocus,
this.checkColor,
this.tristate,
this.activeColor,
this.fillColor,
this.focusColor,
this.overlayColor,
this.splashColor,
this.splashRadius,
this.hoverColor,
this.isError,
this.semanticLabel,
this.side,
this.visualDensity = const VisualDensity(),
});
Пример использования
- Go
CheckBox(
&duit_attributes.CheckboxAttributes[duit_color.ColorString]{
Value: true,
OverlayColor: &duit_material.MaterialStateProperty[duit_color.ColorString]{
Disabled: "#DCDCDC",
},
},
"id",
&duit_core.LocalAction{
Payload: duit_core.UpdateEvent(
map[string]interface{}{
"other_id": map[string]interface{}{
"key": "value",
},
},
),
},
)