SliverSmartList class

A sliver list that builds different items based on breakpoints.

Use SliverSmartList when you need different list layouts per breakpoint.

Example:

SliverSmartList(
  itemCount: items.length,
  mobile: (context, index) => MobileItemTile(items[index]),
  desktop: (context, index) => DesktopItemCard(items[index]),
)
Inheritance
Available extensions

Constructors

SliverSmartList({required int itemCount, Key? key, IndexedWidgetBuilder? watch, IndexedWidgetBuilder? mobile, IndexedWidgetBuilder? tablet, IndexedWidgetBuilder? desktop, IndexedWidgetBuilder? tv, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true})
Creates a SliverSmartList widget.
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
desktop IndexedWidgetBuilder?
Builder for desktop-sized screens.
final
hashCode int
The hash code for this object.
no setterinherited
itemCount int
The number of items in the list.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mobile IndexedWidgetBuilder?
Builder for mobile-sized screens.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tablet IndexedWidgetBuilder?
Builder for tablet-sized screens.
final
tv IndexedWidgetBuilder?
Builder for TV-sized screens.
final
watch IndexedWidgetBuilder?
Builder for watch-sized screens.
final

Methods

aligned(AlignmentGeometry alignment) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Aligns this widget within its parent.
build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
centered() Widget

Available on Widget, provided by the SmartWidgetExtension extension

Centers this widget.
clipped({BorderRadius borderRadius = BorderRadius.zero}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget with a ClipRRect.
constrained({double? minWidth, double? maxWidth, double? minHeight, double? maxHeight}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget in a ConstrainedBox.
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
decorated(BoxDecoration decoration) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget in a DecoratedBox.
expanded({int flex = 1}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Expands this widget to fill available space.
flexible({int flex = 1, FlexFit fit = FlexFit.loose}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Makes this widget flexible.
hideOn(List<SmartBreakpoint> breakpoints, {Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Hides this widget on the specified breakpoints.
hideOnDesktop({Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Hides this widget on desktop and TV breakpoints.
hideOnMobile({Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Hides this widget on mobile and watch breakpoints.
inkWell({VoidCallback? onTap, BorderRadius? borderRadius}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget with Material and InkWell for ripple effects.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onTap(VoidCallback? onTap) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget in a GestureDetector.
opacity(double opacity) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds opacity to this widget.
padded(EdgeInsets padding) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds padding using EdgeInsets.
paddedAll(double value) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds equal padding on all sides.
paddedHorizontal(double value) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds horizontal padding.
paddedSymmetric({double horizontal = 0, double vertical = 0}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds symmetric padding.
paddedVertical(double value) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds vertical padding.
responsivePadding({EdgeInsets? watch, EdgeInsets? mobile, EdgeInsets? tablet, EdgeInsets? desktop, EdgeInsets? tv}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds responsive padding to this widget.
safeArea({bool left = true, bool top = true, bool right = true, bool bottom = true}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget in a SafeArea.
scrollable({Axis scrollDirection = Axis.vertical, EdgeInsets? padding}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget in a SingleChildScrollView.
showOnDesktop({Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Shows this widget only on desktop and TV breakpoints.
showOnly(List<SmartBreakpoint> breakpoints, {Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Shows this widget only on the specified breakpoints.
showOnMobile({Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Shows this widget only on mobile and watch breakpoints.
showOnTablet({Widget? replacement}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Shows this widget only on tablet breakpoint.
sized({double? width, double? height}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Wraps this widget in a SizedBox with the given dimensions.
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
withPadding(SpacingSize size) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds padding using spacing tokens.
withPaddingOnly({SpacingSize? left, SpacingSize? top, SpacingSize? right, SpacingSize? bottom}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds padding on specific sides using spacing tokens.
withSymmetricPadding({SpacingSize? horizontal, SpacingSize? vertical}) Widget

Available on Widget, provided by the SmartWidgetExtension extension

Adds symmetric padding using spacing tokens.

Operators

operator ==(Object other) bool
The equality operator.
inherited