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

Commit 1f1c1af

Browse files
committed
Merge pull request #696 from Hixie/scroll-fix
The ScrollDirection argument needs a default all the way through.
2 parents 01209fe + f1754d9 commit 1f1c1af

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ abstract class Scrollable extends StatefulComponent {
3939
this.scrollDirection: ScrollDirection.vertical
4040
}) : super(key: key) {
4141
assert(scrollDirection == ScrollDirection.vertical ||
42-
scrollDirection == ScrollDirection.horizontal);
42+
scrollDirection == ScrollDirection.horizontal);
4343
}
4444

4545
ScrollDirection scrollDirection;
@@ -347,8 +347,12 @@ class ScrollableBlock extends Component {
347347
// about offscreen widgets consuming resources.
348348
abstract class FixedHeightScrollable extends Scrollable {
349349

350-
FixedHeightScrollable({ Key key, ScrollDirection scrollDirection, this.itemExtent, this.padding })
351-
: super(key: key, scrollDirection: scrollDirection) {
350+
FixedHeightScrollable({
351+
Key key,
352+
ScrollDirection scrollDirection: ScrollDirection.vertical,
353+
this.itemExtent,
354+
this.padding
355+
}) : super(key: key, scrollDirection: scrollDirection) {
352356
assert(itemExtent != null);
353357
}
354358

@@ -468,7 +472,7 @@ typedef Widget ItemBuilder<T>(T item);
468472
class ScrollableList<T> extends FixedHeightScrollable {
469473
ScrollableList({
470474
Key key,
471-
ScrollDirection scrollDirection,
475+
ScrollDirection scrollDirection: ScrollDirection.vertical,
472476
this.items,
473477
this.itemBuilder,
474478
double itemExtent,

0 commit comments

Comments
 (0)