OudsSmallListItem class
OUDS List Item Design Guidelines
Reference design version : 1.0.0
A compact variant of OudsListItem locked to OudsListItemSize.smallSize.
Compared to OudsListItem, this variant:
- Does not support
overlineorextraLabel— only label and description. - Restricts leading content to OudsSmallListItemLeadingIcon and OudsSmallListItemLeadingImage.
- Restricts trailing content to OudsSmallListItemTrailingIcon, OudsSmallListItemTrailingImage and OudsSmallListItemTrailingText.
- Renders all icons and images at
OudsListItemAssetSize.small.
Variants
- Static —
background = falseby default, keeping the compact item transparent unless you opt in to a persistent background. No interaction states. - Navigation — provide onTap to make the item interactive. The entire item
acts as a single link target and supports the following interaction states:
- Enabled — default state; transparent background, item available for navigation.
- Hover — visual feedback when a pointer is over the item. Does not move content, change dimensions, or reveal hidden information.
- Focus — keyboard focus indicator drawn around the complete navigation target (background + border ring).
- Pressed — temporary state while the item is being activated, applied to the entire navigation target.
Parameters
- label: The mandatory main text displayed in the center column.
- contentAlignment: Vertical alignment of all slots within the row (OudsListItemContentAlignment).
- description: Optional secondary text displayed below label.
- leading: Optional leading content. Accepts OudsSmallListItemLeadingIcon or OudsSmallListItemLeadingImage.
- trailing: Optional trailing content. Accepts OudsSmallListItemTrailingIcon, OudsSmallListItemTrailingImage or OudsSmallListItemTrailingText.
- divider: Whether a horizontal divider is drawn below the item. Defaults to
true. - background: Whether the item has a persistent background color. Defaults to
false. This mirrors the constructor default and is delegated to OudsListItem. - decoration: Optional explicit decoration override delegated to OudsListItem. When non-null, it takes precedence over background and divider.
- helperText: Optional helper text displayed below the row (and below the divider).
- boldLabel: Whether label is rendered in bold. Defaults to
false. - enable: Whether the item is interactive. Defaults to
true. - onTap: Callback invoked when the item is tapped. When non-null the item becomes a navigation item and displays an indicator.
- indicator: Navigation indicator. Defaults to OudsListItemDefaults.indicator.
- card: Whether the item should use the card decoration and rounded shape. Defaults to
false.
Usage Example
// Static compact item with a leading icon
OudsSmallListItem(
label: 'Compact item',
description: 'Secondary text',
leading: OudsSmallListItemLeadingIcon(Positive()),
);
// Navigation compact item
OudsSmallListItem(
label: 'Navigate',
onTap: () => Navigator.of(context).push(…),
);
// Compact item with trailing text
OudsSmallListItem(
label: 'Item with price',
trailing: OudsSmallListItemTrailingText('99€'),
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- OudsSmallListItem
Constructors
- OudsSmallListItem({Key? key, required String label, OudsListItemContentAlignment contentAlignment = OudsListItemDefaults.contentAlignment, String? description, OudsSmallListItemLeading? leading, OudsSmallListItemTrailing? trailing, bool divider = true, bool background = false, OudsListItemDecoration? decoration, String? helperText, bool boldLabel = false, bool enable = true, VoidCallback? onTap, OudsListItemIndicator indicator = OudsListItemDefaults.indicator, bool card = false, bool edgeToEdge = true})
-
Creates a compact OUDS list item.
const
Properties
- background → bool
-
Whether the item has a persistent background color. Defaults to
false.final - boldLabel → bool
-
Whether label is rendered in bold. Defaults to
false.final - card → bool
-
Whether this item should use the card decoration and rounded shape.
final
- contentAlignment → OudsListItemContentAlignment
-
Vertical alignment of all slots within the row.
final
- decoration → OudsListItemDecoration?
-
Optional explicit decoration override delegated to OudsListItem.
final
- description → String?
-
Optional secondary text displayed below label.
final
- divider → bool
-
Whether a horizontal divider is drawn below the item. Defaults to
true.final - edgeToEdge → bool
-
Controls the horizontal layout of the item.
final
- enable → bool
-
Whether the item is interactive. Defaults to
true.final - hashCode → int
-
The hash code for this object.
no setterinherited
- helperText → String?
-
Optional helper text displayed below the row (and below the divider).
final
- indicator → OudsListItemIndicator
-
Navigation indicator. Defaults to OudsListItemDefaults.indicator.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- label → String
-
The mandatory main text displayed in the center column.
final
- leading → OudsSmallListItemLeading?
-
Optional content at the start of the row.
final
- onTap → VoidCallback?
-
Callback invoked when the item is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- trailing → OudsSmallListItemTrailing?
-
Optional content at the end of the row.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited