Skip to main content

SwitchStyle

An alias for ToggleStyle, together with the default style used by the Switch component.

type SwitchStyle = ToggleStyle
type SwitchStateColors = ToggleStateColors

var default_switch_style = ToggleStyle(
image: default_switch_image,
width: nil,
height: nil,
padding: EdgeInsets(0),
font_family: default_font,
font_weight: ui.font_weights.normal,
italic: false,
text_size: 12,
text_colors: SwitchStateColors(
resting: Color(0xFFEEEEEE),
hovered: Color(0xFFEEEEEE),
pressed: Color(0xFFEEEEEE),
checked: Color(0xFFEEEEEE),
checked_and_hovered: Color(0xFFEEEEEE),
checked_and_pressed: Color(0xFFEEEEEE),
disabled: Color(0x3DEEEEEE),
checked_and_disabled: Color(0x3DEEEEEE),
),
text_alignment: ui.Alignment.center,
)

ToggleStyle is a shared type between Switch and ToggleButton. This means that the default style of the ToggleButton can also be assigned to the Switch and vice-versa.