ZetaListItem.radio constructor

ZetaListItem.radio({
  1. required dynamic value,
  2. Widget? title,
  3. String? primaryText,
  4. String? secondaryText,
  5. TextStyle? primaryTextStyle,
  6. TextStyle? secondaryTextStyle,
  7. Widget? leading,
  8. bool? showDivider,
  9. dynamic groupValue,
  10. Key? key,
  11. bool? rounded,
  12. ValueChanged? onChanged,
})

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

Implementation

ZetaListItem.radio({
  required dynamic value,
  this.title,
  this.primaryText,
  this.secondaryText,
  this.primaryTextStyle,
  this.secondaryTextStyle,
  this.leading,
  this.showDivider,
  dynamic groupValue,
  super.key,
  super.rounded,
  ValueChanged<dynamic>? onChanged,
})  : trailing = ZetaRadio<dynamic>(
        value: value,
        groupValue: groupValue,
        onChanged: onChanged,
      ),
      onTap = (() => onChanged?.call(value)),
      assert(
        (title != null && primaryText == null && secondaryText == null) ||
            (title == null && (primaryText != null || secondaryText != null)),
        'Provide one of either title or primaryText/secondaryText',
      );