Commit fd510931 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Rename SliverPadding.child to SliverPadding.sliver (#8757)

The new name follows the pattern of the name suggesting which layout
protocol the parent expects the child to speak.

Fixes #8664
parent bd15e8dd
...@@ -139,7 +139,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> { ...@@ -139,7 +139,7 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
final EdgeInsets padding = const EdgeInsets.all(8.0); final EdgeInsets padding = const EdgeInsets.all(8.0);
return new SliverPadding( return new SliverPadding(
padding: padding, padding: padding,
child: new SliverGrid( sliver: new SliverGrid(
gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent( gridDelegate: const SliverGridDelegateWithMaxCrossAxisExtent(
maxCrossAxisExtent: _kRecipePageMaxWidth, maxCrossAxisExtent: _kRecipePageMaxWidth,
crossAxisSpacing: 8.0, crossAxisSpacing: 8.0,
......
...@@ -381,7 +381,7 @@ class _ShrineHomeState extends State<ShrineHome> { ...@@ -381,7 +381,7 @@ class _ShrineHomeState extends State<ShrineHome> {
), ),
new SliverPadding( new SliverPadding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: new SliverGrid( sliver: new SliverGrid(
gridDelegate: gridDelegate, gridDelegate: gridDelegate,
delegate: new SliverChildListDelegate( delegate: new SliverChildListDelegate(
_products.map((Product product) { _products.map((Product product) {
......
...@@ -197,7 +197,7 @@ class _OrderPageState extends State<OrderPage> { ...@@ -197,7 +197,7 @@ class _OrderPageState extends State<OrderPage> {
), ),
new SliverPadding( new SliverPadding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: new SliverGrid( sliver: new SliverGrid(
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
mainAxisSpacing: 8.0, mainAxisSpacing: 8.0,
......
...@@ -1492,8 +1492,8 @@ class SliverPadding extends SingleChildRenderObjectWidget { ...@@ -1492,8 +1492,8 @@ class SliverPadding extends SingleChildRenderObjectWidget {
SliverPadding({ SliverPadding({
Key key, Key key,
@required this.padding, @required this.padding,
Widget child, Widget sliver,
}) : super(key: key, child: child) { }) : super(key: key, child: sliver) {
assert(padding != null); assert(padding != null);
} }
......
...@@ -172,7 +172,7 @@ abstract class BoxScrollView extends ScrollView { ...@@ -172,7 +172,7 @@ abstract class BoxScrollView extends ScrollView {
List<Widget> buildSlivers(BuildContext context) { List<Widget> buildSlivers(BuildContext context) {
Widget sliver = buildChildLayout(context); Widget sliver = buildChildLayout(context);
if (padding != null) if (padding != null)
sliver = new SliverPadding(padding: padding, child: sliver); sliver = new SliverPadding(padding: padding, sliver: sliver);
return <Widget>[ sliver ]; return <Widget>[ sliver ];
} }
......
...@@ -145,7 +145,7 @@ void main() { ...@@ -145,7 +145,7 @@ void main() {
), ),
new SliverPadding( new SliverPadding(
padding: const EdgeInsets.only(top: appBarHeight), padding: const EdgeInsets.only(top: appBarHeight),
child: new SliverList( sliver: new SliverList(
delegate: new SliverChildListDelegate(new List<Widget>.generate( delegate: new SliverChildListDelegate(new List<Widget>.generate(
10, (int index) => new SizedBox(height: 100.0, child: new Text('B$index')), 10, (int index) => new SizedBox(height: 100.0, child: new Text('B$index')),
)), )),
......
...@@ -93,7 +93,7 @@ void main() { ...@@ -93,7 +93,7 @@ void main() {
new SliverToBoxAdapter(child: new Container(height: 520.0)), new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverPadding( new SliverPadding(
padding: const EdgeInsets.all(50.0), padding: const EdgeInsets.all(50.0),
child: new SliverToBoxAdapter(child: new Container(height: 520.0)), sliver: 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 SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), floating: true), new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(150.0), floating: true),
...@@ -105,7 +105,7 @@ void main() { ...@@ -105,7 +105,7 @@ void main() {
new SliverToBoxAdapter(child: new Container(height: 520.0)), new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverPadding( new SliverPadding(
padding: const EdgeInsets.all(50.0), padding: const EdgeInsets.all(50.0),
child: new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true), sliver: new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
), ),
new SliverToBoxAdapter(child: new Container(height: 520.0)), new SliverToBoxAdapter(child: new Container(height: 520.0)),
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true), new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0), pinned: true),
...@@ -146,7 +146,7 @@ void main() { ...@@ -146,7 +146,7 @@ void main() {
new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0)), new SliverPersistentHeader(delegate: new TestSliverPersistentHeaderDelegate(250.0)),
new SliverPadding( new SliverPadding(
padding: const EdgeInsets.symmetric(horizontal: 50.0), padding: const EdgeInsets.symmetric(horizontal: 50.0),
child: new SliverToBoxAdapter(child: new Container(height: 520.0)), sliver: 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 SliverToBoxAdapter(child: new Container(height: 520.0)), new SliverToBoxAdapter(child: new Container(height: 520.0)),
......
...@@ -14,7 +14,7 @@ Future<Null> test(WidgetTester tester, double offset, EdgeInsets padding, AxisDi ...@@ -14,7 +14,7 @@ Future<Null> test(WidgetTester tester, double offset, EdgeInsets padding, AxisDi
new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('before'))), new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('before'))),
new SliverPadding( new SliverPadding(
padding: padding, padding: padding,
child: new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('padded'))), sliver: new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('padded'))),
), ),
new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('after'))), new SliverToBoxAdapter(child: new SizedBox(width: 400.0, height: 400.0, child: new Text('after'))),
], ],
......
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