From a9643aea3cec2da6cb4983fa6a50cc1cc19a8def Mon Sep 17 00:00:00 2001 From: Hixie Date: Wed, 19 Aug 2015 12:20:18 -0700 Subject: [PATCH] The ScrollDirection argument needs a default all the way through. Fixes the Stocks crash on startup. --- packages/flutter/lib/widgets/scrollable.dart | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/flutter/lib/widgets/scrollable.dart b/packages/flutter/lib/widgets/scrollable.dart index e594845e69b..d7a836e62fd 100644 --- a/packages/flutter/lib/widgets/scrollable.dart +++ b/packages/flutter/lib/widgets/scrollable.dart @@ -39,7 +39,7 @@ abstract class Scrollable extends StatefulComponent { this.scrollDirection: ScrollDirection.vertical }) : super(key: key) { assert(scrollDirection == ScrollDirection.vertical || - scrollDirection == ScrollDirection.horizontal); + scrollDirection == ScrollDirection.horizontal); } ScrollDirection scrollDirection; @@ -347,8 +347,12 @@ class ScrollableBlock extends Component { // about offscreen widgets consuming resources. abstract class FixedHeightScrollable extends Scrollable { - FixedHeightScrollable({ Key key, ScrollDirection scrollDirection, this.itemExtent, this.padding }) - : super(key: key, scrollDirection: scrollDirection) { + FixedHeightScrollable({ + Key key, + ScrollDirection scrollDirection: ScrollDirection.vertical, + this.itemExtent, + this.padding + }) : super(key: key, scrollDirection: scrollDirection) { assert(itemExtent != null); } @@ -468,7 +472,7 @@ typedef Widget ItemBuilder(T item); class ScrollableList extends FixedHeightScrollable { ScrollableList({ Key key, - ScrollDirection scrollDirection, + ScrollDirection scrollDirection: ScrollDirection.vertical, this.items, this.itemBuilder, double itemExtent,