SnapList<T> class
A highly customizable, finite snap-scrolling list.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SnapList
Constructors
-
SnapList({Key? key, required List<
T> items, T? selectedItem, required Widget itemBuilder(BuildContext context, T item, int index, bool isSelected, double centerProgress), SnapListController<T> ? controller, void onItemSelected(T item, int index)?, Axis scrollDirection = Axis.horizontal, AlignmentGeometry itemAlignment = Alignment.center, EdgeInsetsGeometry listPadding = EdgeInsets.zero, double? visibleItemCount, double itemWidth = 60, double itemHeight = 80, double itemSpacing = 12, double focusedItemScale = 1.0, double unfocusedItemScale = 1.0, double unfocusedItemOpacity = 1.0, EdgeInsetsGeometry? focusedItemPadding, double focusRange = 1.0, SnapBehavior snapBehavior = SnapBehavior.singleItem, double maxFlingVelocity = 2000.0, Decoration? startEdgeDecoration, Decoration? endEdgeDecoration, double edgeDecorationSize = 40.0, Widget selectedItemOverlayBuilder(BuildContext, double, double)?, Color? selectedOverlayColor, BorderRadiusGeometry? selectedOverlayBorderRadius, String semanticLabelBuilder(T item)?, ScrollPhysics scrollPhysics = const BouncingScrollPhysics(), Duration snapAnimationDuration = const Duration(milliseconds: 300), Curve snapAnimationCurve = Curves.easeOutQuart, bool lockScroll = false}) -
const
-
SnapList.carousel({Key? key, required List<
T> items, T? selectedItem, required Widget itemBuilder(BuildContext, T, int, bool, double), SnapListController<T> ? controller, void onItemSelected(T, int)?, double itemHeight = 220, double itemSpacing = 16, double visibleItemCount = 1.2, double focusedItemScale = 1.0, double unfocusedItemScale = 0.9, double unfocusedItemOpacity = 0.7, EdgeInsetsGeometry? focusedItemPadding, double focusRange = 1.0, double maxFlingVelocity = 2000.0, SnapBehavior snapBehavior = SnapBehavior.singleItem, Decoration? startEdgeDecoration, Decoration? endEdgeDecoration, EdgeInsetsGeometry listPadding = EdgeInsets.zero, Color? selectedOverlayColor, BorderRadiusGeometry? selectedOverlayBorderRadius}) -
factory
-
SnapList.picker({Key? key, required List<
T> items, T? selectedItem, required Widget itemBuilder(BuildContext, T, int, bool, double), SnapListController<T> ? controller, void onItemSelected(T, int)?, double itemWidth = 150, double visibleItemCount = 3.0, double focusedItemScale = 1.1, double unfocusedItemScale = 0.8, double unfocusedItemOpacity = 0.4, EdgeInsetsGeometry? focusedItemPadding, double focusRange = 1.0, double maxFlingVelocity = 1500.0, SnapBehavior snapBehavior = SnapBehavior.freeScroll, Widget selectedItemOverlayBuilder(BuildContext, double, double)?}) -
factory
Properties
-
controller
→ SnapListController<
T> ? -
final
- edgeDecorationSize → double
-
final
-
final
- endEdgeDecoration → Decoration?
-
final
- focusedItemPadding → EdgeInsetsGeometry?
-
final
- focusedItemScale → double
-
final
- focusRange → double
-
final
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- itemAlignment → AlignmentGeometry
-
final
- itemBuilder → Widget Function(BuildContext context, T item, int index, bool isSelected, double centerProgress)
-
final
- itemHeight → double
-
final
-
items
→ List<
T> -
final
- itemSpacing → double
-
final
- itemWidth → double
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- listPadding → EdgeInsetsGeometry
-
final
- lockScroll → bool
-
final
- maxFlingVelocity → double
-
final
- onItemSelected → void Function(T item, int index)?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection → Axis
-
final
- scrollPhysics → ScrollPhysics
-
final
- selectedItem → T?
-
final
- selectedItemOverlayBuilder → Widget Function(BuildContext, double, double)?
-
final
- selectedOverlayBorderRadius → BorderRadiusGeometry?
-
final
- selectedOverlayColor → Color?
-
final
- semanticLabelBuilder → String Function(T item)?
-
final
- snapAnimationCurve → Curve
-
final
- snapAnimationDuration → Duration
-
final
- snapBehavior → SnapBehavior
-
final
- startEdgeDecoration → Decoration?
-
final
- unfocusedItemOpacity → double
-
final
- unfocusedItemScale → double
-
final
- visibleItemCount → double?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SnapList< T> > -
Creates the mutable state for this widget at a given location in the tree.
override
-
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