The ScrollDirection argument needs a default all the way through.
Fixes the Stocks crash on startup.
This commit is contained in:
parent
7f4aa210c0
commit
a9643aea3c
@ -39,7 +39,7 @@ abstract class Scrollable extends StatefulComponent {
|
|||||||
this.scrollDirection: ScrollDirection.vertical
|
this.scrollDirection: ScrollDirection.vertical
|
||||||
}) : super(key: key) {
|
}) : super(key: key) {
|
||||||
assert(scrollDirection == ScrollDirection.vertical ||
|
assert(scrollDirection == ScrollDirection.vertical ||
|
||||||
scrollDirection == ScrollDirection.horizontal);
|
scrollDirection == ScrollDirection.horizontal);
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollDirection scrollDirection;
|
ScrollDirection scrollDirection;
|
||||||
@ -347,8 +347,12 @@ class ScrollableBlock extends Component {
|
|||||||
// about offscreen widgets consuming resources.
|
// about offscreen widgets consuming resources.
|
||||||
abstract class FixedHeightScrollable extends Scrollable {
|
abstract class FixedHeightScrollable extends Scrollable {
|
||||||
|
|
||||||
FixedHeightScrollable({ Key key, ScrollDirection scrollDirection, this.itemExtent, this.padding })
|
FixedHeightScrollable({
|
||||||
: super(key: key, scrollDirection: scrollDirection) {
|
Key key,
|
||||||
|
ScrollDirection scrollDirection: ScrollDirection.vertical,
|
||||||
|
this.itemExtent,
|
||||||
|
this.padding
|
||||||
|
}) : super(key: key, scrollDirection: scrollDirection) {
|
||||||
assert(itemExtent != null);
|
assert(itemExtent != null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +472,7 @@ typedef Widget ItemBuilder<T>(T item);
|
|||||||
class ScrollableList<T> extends FixedHeightScrollable {
|
class ScrollableList<T> extends FixedHeightScrollable {
|
||||||
ScrollableList({
|
ScrollableList({
|
||||||
Key key,
|
Key key,
|
||||||
ScrollDirection scrollDirection,
|
ScrollDirection scrollDirection: ScrollDirection.vertical,
|
||||||
this.items,
|
this.items,
|
||||||
this.itemBuilder,
|
this.itemBuilder,
|
||||||
double itemExtent,
|
double itemExtent,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user