SliverM3ECardList class
A Material 3 interactive card list for use in CustomScrollViews.
SliverM3ECardList 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.
Use this variant when you need to embed the list alongside other slivers in a CustomScrollView.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- SliverM3ECardList
Constructors
- SliverM3ECardList({Key? key, required int itemCount, required IndexedWidgetBuilder itemBuilder, double outerRadius = 24.0, double innerRadius = 4.0, double gap = 3.0, Color? color, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? margin, void onTap(int index)?, void onLongPress(int index)?, String semanticLabelBuilder(int index)?, MouseCursor? mouseCursor, Color? focusColor, Color? hoverColor, void onFocusChange(int index, bool)?, BorderSide? border, double elevation = 0, Color? splashColor, Color? highlightColor, InteractiveInkFeatureFactory? splashFactory, bool enableFeedback = true, M3EHapticFeedback haptic = M3EHapticFeedback.none, Widget? emptyBuilder, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true})
-
Creates a SliverM3ECardList.
const
Properties
- addAutomaticKeepAlives → bool
-
Whether to wrap each child in an AutomaticKeepAlive.
final
- addRepaintBoundaries → bool
-
Whether to wrap each child in a RepaintBoundary.
final
- addSemanticIndexes → bool
-
Whether to wrap each child in an IndexedSemantics.
final
- border → BorderSide?
-
The border drawn around each card item.
final
- color → Color?
-
The background color for each card.
final
- elevation → double
-
The elevation of the card.
final
- emptyBuilder → Widget?
-
Widget displayed when the list is empty (itemCount is 0).
final
- enableFeedback → bool
-
Whether detected gestures should provide acoustic and/or haptic feedback.
final
- focusColor → Color?
-
The color to use when a card is focused by keyboard navigation.
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
- highlightColor → Color?
-
The highlight color of the ink response when tapped.
final
- hoverColor → Color?
-
The color to use when a card is hovered by a mouse pointer.
final
- 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
- 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
- onFocusChange → void Function(int index, bool)?
-
Called when the focus state of a card changes.
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
- 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
- splashColor → Color?
-
The splash color of the ink response when tapped.
final
- splashFactory → InteractiveInkFeatureFactory?
-
Defines the appearance of the splash.
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