FluentListItem<T extends Object> class

One row of a FluentList.

FluentListItem<String>(
  value: 'ada',
  media: const FluentAvatar(name: 'Ada Lovelace'),
  child: const Text('Ada Lovelace'),
  secondary: const Text('Analytical engine'),
  tertiary: const Text('09:41'),
)

A row is inert on its own: selection, keyboard handling and focus all belong to the list, and it reads them from the nearest FluentList ancestor. Constructing one outside a list asserts.

Passing secondary is what makes the row two-line — Figma's ListItem type axis is exactly "is there a second line".

Pass enabled: false to disable it — a real state, not a visual treatment: the row stops reporting hover and press, refuses focus, is skipped by arrow navigation, and cannot be selected.

Inheritance

Constructors

FluentListItem({Key? key, required T value, Widget? child, Widget? secondary, Widget? tertiary, Widget? media, Widget? trailing, bool enabled = true, FluentListItemStyle? style, String? semanticLabel})
Creates a row.
const

Properties

child Widget?
The title.
final
enabled bool
Whether the row can be selected.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
media Widget?
The leading media slot, after the selection affordance.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondary Widget?
The second line. Its presence makes this a two-line row.
final
semanticLabel String?
Announced by assistive technology in place of the row's own text.
final
style FluentListItemStyle?
Overrides layered over the list's style. Merged last, so it wins.
final
tertiary Widget?
Trailing metadata on the title's line — a timestamp, a count.
final
trailing Widget?
Trailing controls at the end of the row.
final
value → T
Identifies this row within its list. Compared with ==.
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