DefaultSwitch constructor

const DefaultSwitch({
  1. Key? key,
  2. required String text,
  3. bool isSwitched = false,
  4. dynamic onSwitchChanged(
    1. bool
    )?,
  5. double leftPadding = 20,
  6. double rightPadding = 20,
})

Creates a labeled switch widget.

Parameters:

  • text: Label text displayed on the left (required)
  • isSwitched: Initial/controlled switch state (defaults to false)
  • onSwitchChanged: Callback triggered when switch is toggled
  • leftPadding: Left padding in pixels (defaults to 20)
  • rightPadding: Right padding in pixels (defaults to 20)

Implementation

const DefaultSwitch({
  super.key,
  required this.text,
  this.isSwitched = false,
  this.onSwitchChanged,
  this.leftPadding = 20,
  this.rightPadding = 20,
});