Skip to content

Commit 0f73501

Browse files
committed
feat: enable item snapping in carousel views on home page
1 parent 3411fae commit 0f73501

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/screens/home_page.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ class _HomePageState extends State<HomePage> {
107107
constraints: BoxConstraints(maxHeight: playlistHeight),
108108
child: CarouselView.weighted(
109109
flexWeights: const <int>[3, 2, 1],
110+
itemSnapping: true,
110111
onTap: (index) => Navigator.push(
111112
context,
112113
MaterialPageRoute(
@@ -204,6 +205,7 @@ class _HomePageState extends State<HomePage> {
204205
constraints: BoxConstraints(maxHeight: contentHeight),
205206
child: CarouselView.weighted(
206207
flexWeights: const <int>[3, 2, 1],
208+
itemSnapping: true,
207209
onTap: (index) => Navigator.push(
208210
context,
209211
MaterialPageRoute(

0 commit comments

Comments
 (0)