OudsCardItem.labelContent constructor

const OudsCardItem.labelContent({
  1. Key? key,
  2. required Widget labelContent(
    1. BuildContext context,
    2. OudsListItemControlState state
    ),
  3. OudsListItemContentAlignment contentAlignment = OudsCardItemDefaults.contentAlignment,
  4. OudsListItemDecoration decoration = OudsCardItemDefaults.decoration,
  5. String? overline,
  6. String? extraLabel,
  7. String? description,
  8. Widget belowTextContent(
    1. BuildContext context,
    2. OudsListItemControlState state
    )?,
  9. OudsListItemLeading? leading,
  10. OudsListItemTrailing? trailing,
  11. Widget bottomContent(
    1. BuildContext context,
    2. OudsListItemControlState state
    )?,
  12. String? helperText,
  13. bool boldLabel = false,
  14. bool enable = true,
  15. VoidCallback? onTap,
  16. OudsListItemIndicator indicator = OudsCardItemDefaults.indicator,
  17. OudsSkeleton? skeleton,
})

Creates an OUDS card item with fully custom labelContent instead of a plain text label.

Implementation

const OudsCardItem.labelContent({
  super.key,
  required Widget Function(
    BuildContext context,
    OudsListItemControlState state,
  )
  labelContent,
  this.contentAlignment = OudsCardItemDefaults.contentAlignment,
  this.decoration = OudsCardItemDefaults.decoration,
  this.overline,
  this.extraLabel,
  this.description,
  this.belowTextContent,
  this.leading,
  this.trailing,
  this.bottomContent,
  this.helperText,
  this.boldLabel = false,
  this.enable = true,
  this.onTap,
  this.indicator = OudsCardItemDefaults.indicator,
  this.skeleton,
}) : label = null,
     // Field is nullable for the default constructor; the parameter stays
     // non-nullable so that `labelContent: null` is a compile-time error.
     // ignore: prefer_initializing_formals
     labelContent = labelContent;