zeba_academy_snap_scroll 1.0.0
zeba_academy_snap_scroll: ^1.0.0 copied to clipboard
TikTok-style snapping, card snapping, wheel snapping and magnetic scroll behavior.
zeba_academy_snap_scroll #
A powerful Flutter package that provides smooth and customizable snapping scroll experiences, including TikTok-style page snapping, card snapping carousels, wheel pickers, and magnetic scroll behavior.
⨠Features #
- šÆ TikTok-style vertical page snapping
- š“ Card snapping carousel
- š” Wheel snapping picker
- š§² Magnetic scroll behavior
- ā” Smooth spring animations
- š± Horizontal and vertical scrolling support
- šØ Easy-to-use widgets
- š Lightweight and dependency-free
Installation #
Add the package to your pubspec.yaml:
dependencies:
zeba_academy_snap_scroll: ^1.0.0
Then run:
flutter pub get
Import #
import 'package:zeba_academy_snap_scroll/zeba_academy_snap_scroll.dart';
TikTok Style Snap PageView #
Perfect for video feeds, reels, stories, onboarding screens, and full-screen experiences.
SnapPageView(
scrollDirection: Axis.vertical,
children: [
Container(color: Colors.red),
Container(color: Colors.blue),
Container(color: Colors.green),
],
)
Card Snapping Carousel #
Create beautiful snapping card carousels.
SnapCarousel(
items: [
Card(
child: SizedBox(
height: 200,
child: Center(child: Text('Card 1')),
),
),
Card(
child: SizedBox(
height: 200,
child: Center(child: Text('Card 2')),
),
),
],
)
Wheel Snapping Picker #
Ideal for date pickers, option selectors, and settings screens.
SnapWheel(
items: const [
'Apple',
'Banana',
'Orange',
'Mango',
],
onSelected: (index) {
print(index);
},
)
Snap ListView #
Automatically snaps items into position while scrolling.
SnapListView(
itemExtent: 120,
children: List.generate(
20,
(index) => Container(
height: 120,
alignment: Alignment.center,
child: Text('Item $index'),
),
),
)
Custom Snap Physics #
Use snapping behavior with your own scrollable widgets.
ListView.builder(
physics: const SnapScrollPhysics(
itemExtent: 100,
),
itemBuilder: (context, index) {
return SizedBox(
height: 100,
child: Center(
child: Text('Item $index'),
),
);
},
)
Snap Controller #
Control snapping programmatically.
final controller = SnapController();
Dispose when no longer needed:
controller.dispose();
Use Cases #
- TikTok-style feeds
- Instagram Reels clones
- Shorts-style applications
- Product showcases
- Card carousels
- Wheel pickers
- Media galleries
- Onboarding flows
- Content browsers
- Settings selectors
Example #
import 'package:flutter/material.dart';
import 'package:zeba_academy_snap_scroll/zeba_academy_snap_scroll.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SnapPageView(
scrollDirection: Axis.vertical,
children: List.generate(
5,
(index) => Container(
color: Colors.primaries[index],
child: Center(
child: Text(
'Page $index',
style: const TextStyle(
fontSize: 40,
color: Colors.white,
),
),
),
),
),
),
),
);
}
}
Additional Information #
Found a bug or have a feature request?
Feel free to open an issue or contribute improvements to the project.
Contributions, feature requests, and pull requests are always welcome.
About Me #
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects.
You can learn more about me and my work at https://sufyanism.com/ or connect with me on LinkedIn.
Your all-in-one learning hub! #
š Explore courses and resources in coding, tech, and development at zeba.academy and code.zeba.academy.
Empower yourself with practical skills through curated tutorials, real-world projects, and hands-on experience.
Level up your tech game today! š»āØ
Zeba Academy is a learning platform dedicated to coding, technology, and development.
ā” Visit our main site: https://zeba.academy
ā” Explore hands-on courses and resources at: https://code.zeba.academy
ā” Check out our YouTube for more tutorials: https://www.youtube.com/@zeba.academy
ā” Follow us on Instagram: https://www.instagram.com/zeba.academy/
License #
This project is licensed under the MIT License.
Thank you for visiting and supporting open-source development! ā¤ļø