ToggleSwitch constructor

const ToggleSwitch({
  1. Key? key,
  2. required bool checked,
  3. required ValueChanged<bool>? onChanged,
  4. ToggleSwitchThemeData? style,
  5. Widget? content,
  6. bool leadingContent = false,
  7. String? semanticLabel,
  8. Widget? knob,
  9. ToggleSwitchKnobBuilder? knobBuilder,
  10. FocusNode? focusNode,
  11. bool autofocus = false,
})

Creates a toggle switch.

Implementation

const ToggleSwitch({
  super.key,
  required this.checked,
  required this.onChanged,
  this.style,
  this.content,
  this.leadingContent = false,
  this.semanticLabel,
  this.knob,
  this.knobBuilder,
  this.focusNode,
  this.autofocus = false,
});