M3ECardList class

A Material 3 interactive card list with dynamically rounded corners.

M3ECardList renders a vertical list of items, where the first and last items automatically have a larger outer radius, and the inner items have a smaller inner radius, adhering to Material 3's expressive list design.

Inheritance

Constructors

M3ECardList({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, double outerRadius = M3EListCardListTheme.defaultOuterRadius, double innerRadius = M3EListCardListTheme.defaultInnerRadius, double gap = M3EListCardListTheme.defaultGap, Color? color, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, void onTap(int index)?, void onLongPress(int index)?, String semanticLabelBuilder(int index)?, MouseCursor? mouseCursor, M3EHapticFeedback haptic = M3EHapticFeedback.none, Widget? emptyBuilder})
Creates a M3ECardList that uses a Column internally.
const
M3ECardList.builder({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, double outerRadius = M3EListCardListTheme.defaultOuterRadius, double innerRadius = M3EListCardListTheme.defaultInnerRadius, double gap = M3EListCardListTheme.defaultGap, Color? color, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, void onTap(int index)?, void onLongPress(int index)?, String semanticLabelBuilder(int index)?, MouseCursor? mouseCursor, M3EHapticFeedback haptic = M3EHapticFeedback.none, Widget? emptyBuilder, ScrollController? controller, ScrollPhysics? physics, bool shrinkWrap = false, EdgeInsetsGeometry? listPadding})
Creates a M3ECardList that uses a ListView.builder internally.
const

Properties

color Color?
The background color for each card.
final
controller ScrollController?
Controls the scroll position of the list.
final
emptyBuilder Widget?
Widget displayed when the list is empty (itemCount is 0).
final
gap double
The gap space between adjacent items.
final
haptic M3EHapticFeedback
The haptic feedback to provide on tap.
final
hashCode int
The hash code for this object.
no setterinherited
innerRadius double
The radius used for the inner corners of adjoining items.
final
itemBuilder IndexedWidgetBuilder
Signature for a function that creates a widget for a given index.
final
itemCount int
The number of items in the list.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listPadding EdgeInsetsGeometry?
Padding for the scrollable list itself.
final
margin EdgeInsetsGeometry?
The outer margin applied around the entire list of cards.
final
mouseCursor MouseCursor?
The cursor for a mouse pointer when it enters a card's bounds.
final
onLongPress → void Function(int index)?
Optional callback invoked when an item is long-pressed.
final
onTap → void Function(int index)?
Optional callback invoked when an item is tapped.
final
outerRadius double
The radius used for the top corners of the first item, the bottom corners of the last item, and all corners of a single item.
final
padding EdgeInsetsGeometry?
The inner padding applied to the itemBuilder child of each item.
final
physics ScrollPhysics?
How the scroll view should respond to user input.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticLabelBuilder String Function(int index)?
Optional semantic label builder for accessibility.
final
shrinkWrap bool
Whether the scroll view should size itself to fit its children.
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