better feedback for null child to a Block or Column

Fixes #1687.
This commit is contained in:
Ian Hickson 2015-10-25 20:22:55 -07:00
parent a6c473ea95
commit e667b3c097
2 changed files with 7 additions and 3 deletions

View File

@ -272,8 +272,10 @@ abstract class OneChildRenderObjectWidget extends RenderObjectWidget {
/// storage for that child list, it doesn't actually provide the updating
/// logic.)
abstract class MultiChildRenderObjectWidget extends RenderObjectWidget {
const MultiChildRenderObjectWidget({ Key key, this.children })
: super(key: key);
MultiChildRenderObjectWidget({ Key key, this.children })
: super(key: key) {
assert(!children.any((Widget child) => child == null));
}
final List<Widget> children;

View File

@ -384,7 +384,9 @@ class Block extends StatelessComponent {
this.initialScrollOffset,
this.scrollDirection: ScrollDirection.vertical,
this.onScroll
}) : super(key: key);
}) : super(key: key) {
assert(!children.any((Widget child) => child == null));
}
final List<Widget> children;
final double initialScrollOffset;