Commit b6aec82e authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

AppBar -> PersistentHeader (#7899)

parent 53fc96da
......@@ -45,12 +45,12 @@ export 'src/rendering/rotated_box.dart';
export 'src/rendering/semantics.dart';
export 'src/rendering/shifted_box.dart';
export 'src/rendering/sliver.dart';
export 'src/rendering/sliver_app_bar.dart';
export 'src/rendering/sliver_fixed_extent_list.dart';
export 'src/rendering/sliver_grid.dart';
export 'src/rendering/sliver_list.dart';
export 'src/rendering/sliver_multi_box_adaptor.dart';
export 'src/rendering/sliver_padding.dart';
export 'src/rendering/sliver_persistent_header.dart';
export 'src/rendering/stack.dart';
export 'src/rendering/table.dart';
export 'src/rendering/tweens.dart';
......
......@@ -21,10 +21,10 @@ import 'sliver.dart';
/// passed on to the child.
///
/// Applying this to anything but the most mundane sliver is likely to have
/// undesired effects. For example, wrapping a [RenderSliverPinnedAppBar] will
/// cause the app bar to overlap earlier slivers (contrary to the normal
/// behavior of pinned app bars), and while the app bar is pinned, the padding
/// will scroll away.
/// undesired effects. For example, wrapping a
/// [RenderSliverPinnedPersistentHeader] will cause the app bar to overlap
/// earlier slivers (contrary to the normal behavior of pinned app bars), and
/// while the app bar is pinned, the padding will scroll away.
class RenderSliverPadding extends RenderSliver with RenderObjectWithChildMixin<RenderSliver> {
/// Creates a render object that insets its child in a viewport.
///
......
......@@ -15,8 +15,8 @@ import 'object.dart';
import 'sliver.dart';
import 'viewport_offset.dart';
abstract class RenderSliverAppBar extends RenderSliver with RenderObjectWithChildMixin<RenderBox>, RenderSliverHelpers {
RenderSliverAppBar({ RenderBox child }) {
abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObjectWithChildMixin<RenderBox>, RenderSliverHelpers {
RenderSliverPersistentHeader({ RenderBox child }) {
this.child = child;
}
......@@ -76,8 +76,9 @@ abstract class RenderSliverAppBar extends RenderSliver with RenderObjectWithChil
/// Call this whenever [updateChild] would change or mutate the child even if
/// given the same `shrinkOffset` as the last time it was called.
///
/// This must be implemented by [RenderSliverAppBar] subclasses such that the
/// next layout after this call will result in [updateChild] being called.
/// This must be implemented by [RenderSliverPersistentHeader] subclasses such
/// that the next layout after this call will result in [updateChild] being
/// called.
@protected
void markNeedsUpdate() {
markNeedsLayout();
......@@ -129,7 +130,7 @@ abstract class RenderSliverAppBar extends RenderSliver with RenderObjectWithChil
///
/// The argument must be the value of the [child] property.
///
/// This must be implemented by [RenderSliverAppBar] subclasses.
/// This must be implemented by [RenderSliverPersistentHeader] subclasses.
///
/// If there is no child, this should return 0.0.
@override
......@@ -193,8 +194,8 @@ abstract class RenderSliverAppBar extends RenderSliver with RenderObjectWithChil
/// a minimum size before continuing to scroll.
///
/// This sliver makes no effort to avoid overlapping other content.
abstract class RenderSliverScrollingAppBar extends RenderSliverAppBar {
RenderSliverScrollingAppBar({
abstract class RenderSliverScrollingPersistentHeader extends RenderSliverPersistentHeader {
RenderSliverScrollingPersistentHeader({
RenderBox child,
}) : super(child: child);
......@@ -228,8 +229,8 @@ abstract class RenderSliverScrollingAppBar extends RenderSliverAppBar {
/// then shrinks as the viewport continues to scroll.
///
/// This sliver avoids overlapping other earlier slivers where possible.
abstract class RenderSliverPinnedAppBar extends RenderSliverAppBar {
RenderSliverPinnedAppBar({
abstract class RenderSliverPinnedPersistentHeader extends RenderSliverPersistentHeader {
RenderSliverPinnedPersistentHeader({
RenderBox child,
}) : super(child: child);
......@@ -253,8 +254,8 @@ abstract class RenderSliverPinnedAppBar extends RenderSliverAppBar {
}
}
abstract class RenderSliverFloatingAppBar extends RenderSliverAppBar {
RenderSliverFloatingAppBar({
abstract class RenderSliverFloatingPersistentHeader extends RenderSliverPersistentHeader {
RenderSliverFloatingPersistentHeader({
RenderBox child,
}) : super(child: child);
......
......@@ -11,8 +11,9 @@ import 'package:meta/meta.dart';
/// This contrasts to [GrowthDirection] in that it has a third value, [idle],
/// for the case where no scroll is occurring.
///
/// This is used by [RenderSliverFloatingAppBar] to only expand when the user is
/// scrolling in the same direction as the detected scroll offset change.
/// This is used by [RenderSliverFloatingPersistentHeader] to only expand when
/// the user is scrolling in the same direction as the detected scroll offset
/// change.
enum ScrollDirection {
/// No scrolling is underway.
idle,
......@@ -101,9 +102,9 @@ abstract class ViewportOffset extends ChangeNotifier {
/// the viewport's [RenderViewport2.axisDirection].
///
/// This is used by some slivers to determine how to react to a change in
/// scroll offset. For example, [RenderSliverFloatingAppBar] will only expand
/// a floating app bar when the [userScrollDirection] is in the positive
/// scroll offset direction.
/// scroll offset. For example, [RenderSliverFloatingPersistentHeader] will
/// only expand a floating app bar when the [userScrollDirection] is in the
/// positive scroll offset direction.
ScrollDirection get userScrollDirection;
@override
......
......@@ -7,20 +7,20 @@ import 'package:flutter/rendering.dart';
import 'framework.dart';
abstract class SliverAppBarDelegate {
abstract class SliverPersistentHeaderDelegate {
/// Abstract const constructor. This constructor enables subclasses to provide
/// const constructors so that they can be used in const expressions.
const SliverAppBarDelegate();
const SliverPersistentHeaderDelegate();
Widget build(BuildContext context, double shrinkOffset);
double get maxExtent;
bool shouldRebuild(@checked SliverAppBarDelegate oldDelegate);
bool shouldRebuild(@checked SliverPersistentHeaderDelegate oldDelegate);
}
class SliverAppBar extends StatelessWidget {
SliverAppBar({
class SliverPersistentHeader extends StatelessWidget {
SliverPersistentHeader({
Key key,
@required this.delegate,
this.pinned: false,
......@@ -32,7 +32,7 @@ class SliverAppBar extends StatelessWidget {
assert(!pinned || !floating);
}
final SliverAppBarDelegate delegate;
final SliverPersistentHeaderDelegate delegate;
final bool pinned;
......@@ -41,10 +41,10 @@ class SliverAppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
if (pinned)
return new _SliverPinnedAppBar(delegate: delegate);
return new _SliverPinnedPersistentHeader(delegate: delegate);
if (floating)
return new _SliverFloatingAppBar(delegate: delegate);
return new _SliverScrollingAppBar(delegate: delegate);
return new _SliverFloatingPersistentHeader(delegate: delegate);
return new _SliverScrollingPersistentHeader(delegate: delegate);
}
@override
......@@ -62,14 +62,14 @@ class SliverAppBar extends StatelessWidget {
}
}
class _SliverAppBarElement extends RenderObjectElement {
_SliverAppBarElement(_SliverAppBarRenderObjectWidget widget) : super(widget);
class _SliverPersistentHeaderElement extends RenderObjectElement {
_SliverPersistentHeaderElement(_SliverPersistentHeaderRenderObjectWidget widget) : super(widget);
@override
_SliverAppBarRenderObjectWidget get widget => super.widget;
_SliverPersistentHeaderRenderObjectWidget get widget => super.widget;
@override
_RenderSliverAppBarForWidgetsMixin get renderObject => super.renderObject;
_RenderSliverPersistentHeaderForWidgetsMixin get renderObject => super.renderObject;
@override
void mount(Element parent, dynamic newSlot) {
......@@ -84,11 +84,11 @@ class _SliverAppBarElement extends RenderObjectElement {
}
@override
void update(_SliverAppBarRenderObjectWidget newWidget) {
final _SliverAppBarRenderObjectWidget oldWidget = widget;
void update(_SliverPersistentHeaderRenderObjectWidget newWidget) {
final _SliverPersistentHeaderRenderObjectWidget oldWidget = widget;
super.update(newWidget);
final SliverAppBarDelegate newDelegate = newWidget.delegate;
final SliverAppBarDelegate oldDelegate = oldWidget.delegate;
final SliverPersistentHeaderDelegate newDelegate = newWidget.delegate;
final SliverPersistentHeaderDelegate oldDelegate = oldWidget.delegate;
if (newDelegate != oldDelegate &&
(newDelegate.runtimeType != oldDelegate.runtimeType || newDelegate.shouldRebuild(oldDelegate)))
renderObject.triggerRebuild();
......@@ -134,21 +134,21 @@ class _SliverAppBarElement extends RenderObjectElement {
}
}
abstract class _SliverAppBarRenderObjectWidget extends RenderObjectWidget {
_SliverAppBarRenderObjectWidget({
abstract class _SliverPersistentHeaderRenderObjectWidget extends RenderObjectWidget {
_SliverPersistentHeaderRenderObjectWidget({
Key key,
@required this.delegate,
}) : super(key: key) {
assert(delegate != null);
}
final SliverAppBarDelegate delegate;
final SliverPersistentHeaderDelegate delegate;
@override
_SliverAppBarElement createElement() => new _SliverAppBarElement(this);
_SliverPersistentHeaderElement createElement() => new _SliverPersistentHeaderElement(this);
@override
_RenderSliverAppBarForWidgetsMixin createRenderObject(BuildContext context);
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context);
@override
void debugFillDescription(List<String> description) {
......@@ -157,8 +157,8 @@ abstract class _SliverAppBarRenderObjectWidget extends RenderObjectWidget {
}
}
abstract class _RenderSliverAppBarForWidgetsMixin implements RenderSliverAppBar {
_SliverAppBarElement _element;
abstract class _RenderSliverPersistentHeaderForWidgetsMixin implements RenderSliverPersistentHeader {
_SliverPersistentHeaderElement _element;
@override
double get maxExtent => _element.widget.delegate.maxExtent;
......@@ -175,54 +175,54 @@ abstract class _RenderSliverAppBarForWidgetsMixin implements RenderSliverAppBar
}
}
class _SliverScrollingAppBar extends _SliverAppBarRenderObjectWidget {
_SliverScrollingAppBar({
class _SliverScrollingPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget {
_SliverScrollingPersistentHeader({
Key key,
@required SliverAppBarDelegate delegate,
@required SliverPersistentHeaderDelegate delegate,
}) : super(key: key, delegate: delegate);
@override
_RenderSliverAppBarForWidgetsMixin createRenderObject(BuildContext context) {
return new _RenderSliverScrollingAppBarForWidgets();
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
return new _RenderSliverScrollingPersistentHeaderForWidgets();
}
}
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101
abstract class _RenderSliverScrollingAppBar extends RenderSliverScrollingAppBar { }
abstract class _RenderSliverScrollingPersistentHeader extends RenderSliverScrollingPersistentHeader { }
class _RenderSliverScrollingAppBarForWidgets extends _RenderSliverScrollingAppBar
with _RenderSliverAppBarForWidgetsMixin { }
class _RenderSliverScrollingPersistentHeaderForWidgets extends _RenderSliverScrollingPersistentHeader
with _RenderSliverPersistentHeaderForWidgetsMixin { }
class _SliverPinnedAppBar extends _SliverAppBarRenderObjectWidget {
_SliverPinnedAppBar({
class _SliverPinnedPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget {
_SliverPinnedPersistentHeader({
Key key,
@required SliverAppBarDelegate delegate,
@required SliverPersistentHeaderDelegate delegate,
}) : super(key: key, delegate: delegate);
@override
_RenderSliverAppBarForWidgetsMixin createRenderObject(BuildContext context) {
return new _RenderSliverPinnedAppBarForWidgets();
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
return new _RenderSliverPinnedPersistentHeaderForWidgets();
}
}
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101
abstract class _RenderSliverPinnedAppBar extends RenderSliverPinnedAppBar { }
abstract class _RenderSliverPinnedPersistentHeader extends RenderSliverPinnedPersistentHeader { }
class _RenderSliverPinnedAppBarForWidgets extends _RenderSliverPinnedAppBar with _RenderSliverAppBarForWidgetsMixin { }
class _RenderSliverPinnedPersistentHeaderForWidgets extends _RenderSliverPinnedPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
class _SliverFloatingAppBar extends _SliverAppBarRenderObjectWidget {
_SliverFloatingAppBar({
class _SliverFloatingPersistentHeader extends _SliverPersistentHeaderRenderObjectWidget {
_SliverFloatingPersistentHeader({
Key key,
@required SliverAppBarDelegate delegate,
@required SliverPersistentHeaderDelegate delegate,
}) : super(key: key, delegate: delegate);
@override
_RenderSliverAppBarForWidgetsMixin createRenderObject(BuildContext context) {
return new _RenderSliverFloatingAppBarForWidgets();
_RenderSliverPersistentHeaderForWidgetsMixin createRenderObject(BuildContext context) {
return new _RenderSliverFloatingPersistentHeaderForWidgets();
}
}
// This class exists to work around https://github.com/dart-lang/sdk/issues/15101
abstract class _RenderSliverFloatingAppBar extends RenderSliverFloatingAppBar { }
abstract class _RenderSliverFloatingPersistentHeader extends RenderSliverFloatingPersistentHeader { }
class _RenderSliverFloatingAppBarForWidgets extends _RenderSliverFloatingAppBar with _RenderSliverAppBarForWidgetsMixin { }
class _RenderSliverFloatingPersistentHeaderForWidgets extends _RenderSliverFloatingPersistentHeader with _RenderSliverPersistentHeaderForWidgetsMixin { }
......@@ -10,7 +10,6 @@ library widgets;
export 'src/widgets/animated_cross_fade.dart';
export 'src/widgets/animated_size.dart';
export 'src/widgets/app.dart';
export 'src/widgets/app_bar.dart';
export 'src/widgets/async.dart';
export 'src/widgets/banner.dart';
export 'src/widgets/basic.dart';
......@@ -60,6 +59,7 @@ export 'src/widgets/semantics_debugger.dart';
export 'src/widgets/single_child_scroll_view.dart';
export 'src/widgets/size_changed_layout_notifier.dart';
export 'src/widgets/sliver.dart';
export 'src/widgets/sliver_persistent_header.dart';
export 'src/widgets/status_transitions.dart';
export 'src/widgets/table.dart';
export 'src/widgets/text.dart';
......
......@@ -32,7 +32,7 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(height: bigHeight),
new SliverAppBar(delegate: new TestDelegate(), floating: true),
new SliverPersistentHeader(delegate: new TestDelegate(), floating: true),
new BigSliver(height: bigHeight),
],
),
......@@ -60,7 +60,7 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey(), height: bigHeight),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: delegate, floating: true),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: delegate, floating: true),
new BigSliver(key: key3 = new GlobalKey(), height: bigHeight),
],
),
......@@ -130,7 +130,7 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey(), height: bigHeight),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: delegate, floating: true),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: delegate, floating: true),
new BigSliver(key: key3 = new GlobalKey(), height: bigHeight),
],
),
......@@ -163,7 +163,7 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey(), height: bigHeight),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: delegate, floating: true),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: delegate, floating: true),
new BigSliver(key: key3 = new GlobalKey(), height: bigHeight),
],
),
......@@ -190,7 +190,7 @@ void main() {
});
}
class TestDelegate extends SliverAppBarDelegate {
class TestDelegate extends SliverPersistentHeaderDelegate {
@override
double get maxExtent => 200.0;
......
......@@ -33,8 +33,8 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey(), height: bigHeight),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverAppBar(key: key3 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverPersistentHeader(key: key3 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new BigSliver(key: key4 = new GlobalKey(), height: bigHeight),
new BigSliver(key: key5 = new GlobalKey(), height: bigHeight),
],
......@@ -67,8 +67,8 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey(), height: bigHeight),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverAppBar(key: key3 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverPersistentHeader(key: key3 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new BigSliver(key: key4 = new GlobalKey(), height: bigHeight),
new BigSliver(key: key5 = new GlobalKey(), height: bigHeight),
],
......@@ -157,8 +157,8 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey(), height: bigHeight),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverAppBar(key: key3 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new SliverPersistentHeader(key: key3 = new GlobalKey(), delegate: new TestDelegate(), pinned: true),
new BigSliver(key: key4 = new GlobalKey(), height: bigHeight),
new BigSliver(key: key5 = new GlobalKey(), height: bigHeight),
],
......@@ -184,7 +184,7 @@ void main() {
});
}
class TestDelegate extends SliverAppBarDelegate {
class TestDelegate extends SliverPersistentHeaderDelegate {
@override
double get maxExtent => 200.0;
......
......@@ -24,8 +24,8 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(key: key1 = new GlobalKey()),
new SliverAppBar(key: key2 = new GlobalKey(), delegate: new TestDelegate()),
new SliverAppBar(key: key3 = new GlobalKey(), delegate: new TestDelegate()),
new SliverPersistentHeader(key: key2 = new GlobalKey(), delegate: new TestDelegate()),
new SliverPersistentHeader(key: key3 = new GlobalKey(), delegate: new TestDelegate()),
new BigSliver(key: key4 = new GlobalKey()),
new BigSliver(key: key5 = new GlobalKey()),
],
......@@ -58,7 +58,7 @@ void main() {
axisDirection: AxisDirection.down,
slivers: <Widget>[
new BigSliver(),
new SliverAppBar(key: key, delegate: delegate),
new SliverPersistentHeader(key: key, delegate: delegate),
new BigSliver(),
new BigSliver(),
],
......@@ -73,7 +73,7 @@ void main() {
});
}
class TestDelegate extends SliverAppBarDelegate {
class TestDelegate extends SliverPersistentHeaderDelegate {
@override
double get maxExtent => 200.0;
......
......@@ -9,8 +9,8 @@ import 'package:flutter/material.dart';
import 'test_widgets.dart';
class TestSliverAppBarDelegate extends SliverAppBarDelegate {
TestSliverAppBarDelegate(this._maxExtent);
class TestSliverPersistentHeaderDelegate extends SliverPersistentHeaderDelegate {
TestSliverPersistentHeaderDelegate(this._maxExtent);
final double _maxExtent;
......@@ -28,7 +28,7 @@ class TestSliverAppBarDelegate extends SliverAppBarDelegate {
}
@override
bool shouldRebuild(TestSliverAppBarDelegate oldDelegate) => false;
bool shouldRebuild(TestSliverPersistentHeaderDelegate oldDelegate) => false;
}
class TestBehavior extends ScrollBehavior2 {
......@@ -84,38 +84,38 @@ void main() {
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(150.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), pinned: true),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverPadding(
padding: new EdgeInsets.all(50.0),
child: new SliverToBoxAdapter(child: new Container(height: 520.0)),
),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(150.0), floating: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), floating: true),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverToBoxAdapter(key: centerKey, child: new Container(height: 520.0)), // ------------------------ CENTER ------------------------
new SliverAppBar(delegate: new TestSliverAppBarDelegate(150.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), pinned: true),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverPadding(
padding: new EdgeInsets.all(50.0),
child: new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0), pinned: true),
child: new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
new SliverToBoxAdapter(child: new Container(height: 5.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
new SliverToBoxAdapter(child: new Container(height: 5.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0), pinned: true),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
new SliverToBoxAdapter(child: new Container(height: 5.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0), pinned: true),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0)),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0)),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(150.0), floating: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), floating: true),
new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(150.0), floating: true),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), floating: true),
new SliverToBoxAdapter(child: new Container(height: 5.0)),
new SliverList(
delegate: new SliverChildListDelegate(<Widget>[
......@@ -136,9 +136,9 @@ void main() {
new Container(height: 50.0),
]),
),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0)),
new SliverAppBar(delegate: new TestSliverAppBarDelegate(250.0)),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0)),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0)),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0)),
new SliverPadding(
padding: new EdgeInsets.symmetric(horizontal: 50.0),
child: new SliverToBoxAdapter(child: new Container(height: 520.0)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment