KSmoothListView class

A ListView that provides buttery-smooth scrolling on desktop platforms while maintaining native scroll behavior on mobile.

This widget wraps Flutter's standard ListView and adds:

  • Continuous frame-by-frame scroll updates (no lag/freeze)
  • Platform-tuned momentum physics
  • Immediate response to scroll input

On mobile platforms, it behaves exactly like a standard ListView with zero performance overhead.

Example:

SmoothListView.builder(
  itemCount: 100,
  itemBuilder: (context, index) => ListTile(
    title: Text('Item $index'),
  ),
)
Inheritance

Constructors

KSmoothListView({Key? key, required List<Widget> children, KSmoothScrollMode mode = KSmoothScrollMode.auto, KScrollIntensity intensity = KScrollIntensity.slow, SmoothScrollPhysics? customPhysics, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, Clip clipBehavior = Clip.hardEdge, ScrollController? controller, DragStartBehavior dragStartBehavior = DragStartBehavior.start, double? itemExtent, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, Widget? prototypeItem, String? restorationId, bool reverse = false, Axis scrollDirection = Axis.vertical, int? semanticChildCount, bool shrinkWrap = false})
const

Properties

addAutomaticKeepAlives bool
final
addRepaintBoundaries bool
final
addSemanticIndexes bool
final
cacheExtent double?
final
children List<Widget>
final
clipBehavior Clip
final
controller ScrollController?
final
customPhysics SmoothScrollPhysics?
Custom physics for power users. If provided, this overrides intensity.
final
dragStartBehavior DragStartBehavior
final
hashCode int
The hash code for this object.
no setterinherited
intensity KScrollIntensity
The intensity/feel of the scrolling. Defaults to KScrollIntensity.medium.
final
itemExtent double?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyboardDismissBehavior ScrollViewKeyboardDismissBehavior
final
mode KSmoothScrollMode
The mode determining when smooth scroll is applied. Defaults to KSmoothScrollMode.auto.
final
padding EdgeInsetsGeometry?
final
physics ScrollPhysics?
final
primary bool?
final
prototypeItem Widget?
final
restorationId String?
final
reverse bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scrollDirection Axis
final
semanticChildCount int?
final
shrinkWrap bool
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

Static Methods

builder({Key? key, required IndexedWidgetBuilder itemBuilder, int? itemCount, KSmoothScrollMode mode = KSmoothScrollMode.auto, KScrollIntensity intensity = KScrollIntensity.slow, SmoothScrollPhysics? customPhysics, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, Clip clipBehavior = Clip.hardEdge, ScrollController? controller, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ChildIndexGetter? findItemIndexCallback, double? itemExtent, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, Widget? prototypeItem, String? restorationId, bool reverse = false, Axis scrollDirection = Axis.vertical, int? semanticChildCount, bool shrinkWrap = false}) Widget
Builder constructor for dynamic lists
custom({Key? key, required SliverChildDelegate childrenDelegate, KSmoothScrollMode mode = KSmoothScrollMode.auto, KScrollIntensity intensity = KScrollIntensity.slow, SmoothScrollPhysics? customPhysics, double? cacheExtent, Clip clipBehavior = Clip.hardEdge, ScrollController? controller, DragStartBehavior dragStartBehavior = DragStartBehavior.start, double? itemExtent, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, Widget? prototypeItem, String? restorationId, bool reverse = false, Axis scrollDirection = Axis.vertical, int? semanticChildCount, bool shrinkWrap = false}) Widget
Custom constructor for advanced use cases
separated({Key? key, required IndexedWidgetBuilder itemBuilder, required IndexedWidgetBuilder separatorBuilder, required int itemCount, KSmoothScrollMode mode = KSmoothScrollMode.auto, KScrollIntensity intensity = KScrollIntensity.slow, SmoothScrollPhysics? customPhysics, bool addAutomaticKeepAlives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, double? cacheExtent, Clip clipBehavior = Clip.hardEdge, ScrollController? controller, DragStartBehavior dragStartBehavior = DragStartBehavior.start, ChildIndexGetter? findItemIndexCallback, double? itemExtent, ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, EdgeInsetsGeometry? padding, ScrollPhysics? physics, bool? primary, Widget? prototypeItem, String? restorationId, bool reverse = false, Axis scrollDirection = Axis.vertical, int? semanticChildCount, bool shrinkWrap = false}) Widget
Separated constructor for lists with separators