ZetaListItem.toggle constructor

ZetaListItem.toggle({
  1. Key? key,
  2. bool? rounded,
  3. required String primaryText,
  4. String? secondaryText,
  5. bool? showDivider,
  6. Widget? leading,
  7. bool value = false,
  8. ValueChanged<bool?>? onChanged,
})

Creates a ZetaListItem with a ZetaSwitch in the trailing widget space.

Implementation

ZetaListItem.toggle({
  super.key,
  super.rounded,
  required this.primaryText,
  this.secondaryText,
  this.showDivider,
  this.leading,
  bool value = false,
  ValueChanged<bool?>? onChanged,
})  : trailing = ZetaSwitch(
        value: value,
        onChanged: onChanged,
        variant: ZetaSwitchType.android,
      ),
      onTap = (() => onChanged?.call(!value));