Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit ed041a2

Browse files
committed
Merge pull request #1501 from abarth/initial_page
PageableList should take initialPage instead of initialScrollOffset
2 parents 35662d0 + 06e49c0 commit ed041a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sky/packages/sky/lib/src/widgets/scrollable.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ typedef void PageChangedCallback(int newPage);
575575
class PageableList<T> extends ScrollableList<T> {
576576
PageableList({
577577
Key key,
578-
double initialScrollOffset,
578+
int initialPage,
579579
ScrollDirection scrollDirection: ScrollDirection.horizontal,
580580
ScrollListener onScroll,
581581
List<T> items,
@@ -588,7 +588,7 @@ class PageableList<T> extends ScrollableList<T> {
588588
this.curve: ease
589589
}) : super(
590590
key: key,
591-
initialScrollOffset: initialScrollOffset,
591+
initialScrollOffset: initialPage == null ? null : initialPage * itemExtent,
592592
scrollDirection: scrollDirection,
593593
onScroll: onScroll,
594594
items: items,

0 commit comments

Comments
 (0)