snapping_page_scroll
3.1.0, released 3 years ago by solidred.se
A PageView that snaps to the nearest page or scrolls multiple pages based on scroll velocity.
What it does
It provides a PageView-like widget that disables snapping when the user scrolls faster than a threshold, allowing multi-page scrolls, and re-enables snapping when the velocity slows. The widget can be controlled via a PageController.
AI-written summary of version 3.1.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a carousel that behaves differently based on swipe speed
- You want to avoid page snapping during fast swipes
- You prefer a declarative widget over custom scroll logic
Skip it when
- You need fine-grained control over scroll physics beyond velocity thresholds
- You are building a non-page-based scrollable list
Strengths
- Simple API, single widget, no extra dependencies
- Supports all Flutter platforms
- Built-in velocity-based snapping logic
- Compatible with PageController for navigation
Weaknesses
- No support for custom scroll physics beyond velocity threshold
- Limited to page-based scrolling only
- No built-in page indicators or animations
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
Add dependency in pubspec.yaml and import package
import 'package:flutter/material.dart';
import 'package:snapping_page_scroll/snapping_page_scroll.dart';
class Demo extends StatelessWidget {
final controller = PageController(viewportFraction: 0.75);
@override
Widget build(BuildContext context) {
return SnappingPageScroll(
controller: controller,
children: List.generate(6, (i) => Card(child: Text('Card ${i+1}'))),
);
}
}Alternatives
Packages that do the same job and could replace snapping_page_scroll.
- expandable_page_view
A PageView widget that automatically adjusts its height to the currently displayed page.
88Compare - linked_pageview
Synchronize scroll activity and viewport fractions across multiple PageViews
53Compare - onboarding
This is a widget that allows developers to create an on-boarding landing page for flutter applications.
50Compare - hidable
A widget that makes any static located widget hidable on scroll.
50Compare