Package selection guidance compiled from public package information, community data, and project usage.
ScrollSnapList is a Flutter widget designed to enable smooth, snap-to-item scrolling in lists. When users scroll, the list automatically snaps to the nearest item, enhancing navigation in carousel-like or paginated interfaces. It supports all major platforms including Android, iOS, Web, macOS, Windows, and Linux. The package simplifies implementation of scroll-based interactions where precise alignment to list items is essential, such as in image sliders, onboarding screens, or tabbed content. Built with performance and ease of use in mind, it integrates seamlessly into existing Flutter projects.
Key for ScrollSnapList, used to call ScrollSnapListState
listViewKey
Key for ListView inside ScrollSnapListState, often used to preserve scroll location
itemBuilder
Same as ListView's itemBuilder
curve
Animation curve when snapping
duration
Animation duration
endOfListTolerance
Pixel tolerance to trigger onReachEnd
focusOnItemTap
Focus to an item when user tap on it. Inactive if the list-item have its own onTap detector (use state-key to help focusing instead).
focusToItem
Method to manually trigger focus to an item. Call with help of GlobalKey<ScrollSnapListState>
margin
Container's margin
itemCount
Number of item in this list
itemSize
Size used is width if scrollDirection is Axis.horizontal, height if Axis.vertical. Composed of the size of each item + its margin/padding.
onItemFocus
Callback function when list snaps/focuses to an item
onReachEnd
Callback function when user reach end of list. E.g. load more data from db
reverse
Same as ListView's reverse to reverse scrollDirection
updateOnScroll
Calls onItemFocus (if it exists) when ScrollUpdateNotification fires
initialIndex
Optional initial position which will not snap until after the first drag
scrollDirection
ListView's scrollDirection
listController
External ScrollController
dynamicItemSize
Scale item's size depending on distance to center
dynamicSizeEquation
Custom equation to determine dynamic item scaling calculation
dynamicItemOpacity
Custom opacity for offset item (single value)
selectedItemAnchor
Anchor location for selected item in the list (Start, Middle, End)
shrinkWrap
ListView's shrinkWrap
scrollPhysics
ListView's scrollPhysics
clipBehavior
ListView's clipBehavior
keyboardDismissBehavior
ListView's keyboardDismissBehavior
allowAnotherDirection
Allow List items to be scrolled using other direction
dispatchScrollNotifications
Control if ScrollNotifications should be dispatched to further ancestors. Default: false
Other Notice
By default, SnapScrollList set focusOnItemTap as true. Means any tap event on items will trigger snap/focus event to that item.
This behavior use GestureDetector, so if the list's items have their own detector (e.g. InkWell, Button), SnapScrollList unable to trigger snap event on its own. To handle this, we may use GlobalKey<ScrollSnapListState> to trigger the event manually.