OudsListItem constructor

const OudsListItem({
  1. Key? key,
  2. required String label,
  3. OudsListItemSize size = OudsListItemSize.defaultSize,
  4. OudsListItemContentAlignment contentAlignment = OudsListItemDefaults.contentAlignment,
  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. bool divider = true,
  13. bool background = false,
  14. OudsListItemDecoration? decoration,
  15. String? helperText,
  16. bool boldLabel = false,
  17. bool enable = true,
  18. VoidCallback? onTap,
  19. OudsListItemIndicator indicator = OudsListItemDefaults.indicator,
  20. bool card = false,
  21. bool edgeToEdge = true,
  22. OudsSkeleton? skeleton,
})

Creates an OUDS list item with a plain text label.

Implementation

const OudsListItem({
  super.key,
  required String label,
  this.size = OudsListItemSize.defaultSize,
  this.contentAlignment = OudsListItemDefaults.contentAlignment,
  this.overline,
  this.extraLabel,
  this.description,
  this.belowTextContent,
  this.leading,
  this.trailing,
  this.bottomContent,
  this.divider = true,
  this.background = false,
  this.decoration,
  this.helperText,
  this.boldLabel = false,
  this.enable = true,
  this.onTap,
  this.indicator = OudsListItemDefaults.indicator,
  this.card = false,
  this.edgeToEdge = true,
  this.skeleton,
  // Field is nullable for the .labelContent constructor; the parameter stays
  // non-nullable so that `label: null` is a compile-time error.
  // ignore: prefer_initializing_formals
}) : label = label,
     labelContent = null;