Added a flexible appbar gallery demo

This commit is contained in:
Hans Muller
2016-02-03 16:18:17 -08:00
parent aa6c761a1d
commit 8741f33ebe
5 changed files with 370 additions and 17 deletions

View File

@@ -446,7 +446,8 @@ class Block extends StatelessComponent {
this.padding,
this.initialScrollOffset,
this.scrollDirection: Axis.vertical,
this.onScroll
this.onScroll,
this.scrollableKey
}) : super(key: key) {
assert(!children.any((Widget child) => child == null));
}
@@ -456,12 +457,14 @@ class Block extends StatelessComponent {
final double initialScrollOffset;
final Axis scrollDirection;
final ScrollListener onScroll;
final Key scrollableKey;
Widget build(BuildContext context) {
Widget contents = new BlockBody(children: children, direction: scrollDirection);
if (padding != null)
contents = new Padding(padding: padding, child: contents);
return new ScrollableViewport(
key: scrollableKey,
initialScrollOffset: initialScrollOffset,
scrollDirection: scrollDirection,
onScroll: onScroll,