Toggle

toggle

Toggle is a switcher between two states. Most common toggles are used to switch between as on/off in preferences or settings.

Usage

XelaToggle(
    size: XelaToggleSize.LARGE,
    onBackground: XelaColor.Blue3,
    offBackground: XelaColor.Gray11,
    circleOnColor: Colors.white,
    circleOffColor: Colors.white,
    onToggle: (isChecked) {  },
    content: Text("Label", style: XelaTextStyle.XelaButtonMedium.apply(color: XelaColor.Gray2)),
)

Properties XelaToggleStyle

Name Type Default Value Required Description
iconOn Widget? null NO Icon ON widget on toggle
iconOff Widget? null NO Icon OFF widget on toggle
onToggle Function(bool) null On toggle change action
size XelaToggleSize XelaToggleSize.MEDIUM NO Toggle size (LARGE, MEDIUM, LOW)
onBackgound Color XelaColor.Blue3 NO Toggle ON background
offBackground Color XelaColor.Gray11 NO Toggle OFF background
circleOnColor Color Colors.white NO Toggle ON circle color
circleOffColor Color Colors.white NO Toggle OFF circle color
status bool false NO Toggle is checked
content Widget? null NO Toggle content