Commit 0f900116 authored by Adam Barth's avatar Adam Barth Committed by Andrew Wilson

Rename Stack.sizing to Stack.fit (#9615)

The enum is called StackFit, so the property name "fit" makes more sense.
parent 3c3b003f
...@@ -429,7 +429,7 @@ class InputDecorator extends StatelessWidget { ...@@ -429,7 +429,7 @@ class InputDecorator extends StatelessWidget {
} }
final Widget stack = new Stack( final Widget stack = new Stack(
sizing: StackFit.passthrough, fit: StackFit.passthrough,
children: stackChildren children: stackChildren
); );
......
...@@ -202,7 +202,7 @@ class StackParentData extends ContainerBoxParentDataMixin<RenderBox> { ...@@ -202,7 +202,7 @@ class StackParentData extends ContainerBoxParentDataMixin<RenderBox> {
/// How to size the non-positioned children of a [Stack]. /// How to size the non-positioned children of a [Stack].
/// ///
/// This enum is used with [Stack.sizing] and [RenderStack.sizing] to control /// This enum is used with [Stack.fit] and [RenderStack.fit] to control
/// how the [BoxConstraints] passed from the stack's parent to the stack's child /// how the [BoxConstraints] passed from the stack's parent to the stack's child
/// are adjusted. /// are adjusted.
/// ///
...@@ -298,13 +298,13 @@ class RenderStack extends RenderBox ...@@ -298,13 +298,13 @@ class RenderStack extends RenderBox
RenderStack({ RenderStack({
List<RenderBox> children, List<RenderBox> children,
FractionalOffset alignment: FractionalOffset.center, FractionalOffset alignment: FractionalOffset.center,
StackFit sizing: StackFit.loose, StackFit fit: StackFit.loose,
Overflow overflow: Overflow.clip Overflow overflow: Overflow.clip
}) : _alignment = alignment, }) : _alignment = alignment,
_sizing = sizing, _fit = fit,
_overflow = overflow { _overflow = overflow {
assert(alignment != null); assert(alignment != null);
assert(sizing != null); assert(fit != null);
assert(overflow != null); assert(overflow != null);
addAll(children); addAll(children);
} }
...@@ -338,12 +338,12 @@ class RenderStack extends RenderBox ...@@ -338,12 +338,12 @@ class RenderStack extends RenderBox
/// The constraints passed into the [RenderStack] from its parent are either /// The constraints passed into the [RenderStack] from its parent are either
/// loosened ([StackFit.loose]) or tightened to their biggest size /// loosened ([StackFit.loose]) or tightened to their biggest size
/// ([StackFit.expand]). /// ([StackFit.expand]).
StackFit get sizing => _sizing; StackFit get fit => _fit;
StackFit _sizing; StackFit _fit;
set sizing(StackFit value) { set fit(StackFit value) {
assert(value != null); assert(value != null);
if (_sizing != value) { if (_fit != value) {
_sizing = value; _fit = value;
markNeedsLayout(); markNeedsLayout();
} }
} }
...@@ -409,8 +409,8 @@ class RenderStack extends RenderBox ...@@ -409,8 +409,8 @@ class RenderStack extends RenderBox
double height = constraints.minHeight; double height = constraints.minHeight;
BoxConstraints nonPositionedConstraints; BoxConstraints nonPositionedConstraints;
assert(sizing != null); assert(fit != null);
switch (sizing) { switch (fit) {
case StackFit.loose: case StackFit.loose:
nonPositionedConstraints = constraints.loosen(); nonPositionedConstraints = constraints.loosen();
break; break;
......
...@@ -1648,7 +1648,7 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -1648,7 +1648,7 @@ class Stack extends MultiChildRenderObjectWidget {
Stack({ Stack({
Key key, Key key,
this.alignment: FractionalOffset.topLeft, this.alignment: FractionalOffset.topLeft,
this.sizing: StackFit.loose, this.fit: StackFit.loose,
this.overflow: Overflow.clip, this.overflow: Overflow.clip,
List<Widget> children: const <Widget>[], List<Widget> children: const <Widget>[],
}) : super(key: key, children: children); }) : super(key: key, children: children);
...@@ -1666,7 +1666,7 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -1666,7 +1666,7 @@ class Stack extends MultiChildRenderObjectWidget {
/// The constraints passed into the [Stack] from its parent are either /// The constraints passed into the [Stack] from its parent are either
/// loosened ([StackFit.loose]) or tightened to their biggest size /// loosened ([StackFit.loose]) or tightened to their biggest size
/// ([StackFit.expand]). /// ([StackFit.expand]).
final StackFit sizing; final StackFit fit;
/// Whether overflowing children should be clipped. See [Overflow]. /// Whether overflowing children should be clipped. See [Overflow].
/// ///
...@@ -1678,7 +1678,7 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -1678,7 +1678,7 @@ class Stack extends MultiChildRenderObjectWidget {
RenderStack createRenderObject(BuildContext context) { RenderStack createRenderObject(BuildContext context) {
return new RenderStack( return new RenderStack(
alignment: alignment, alignment: alignment,
sizing: sizing, fit: fit,
overflow: overflow, overflow: overflow,
); );
} }
...@@ -1687,7 +1687,7 @@ class Stack extends MultiChildRenderObjectWidget { ...@@ -1687,7 +1687,7 @@ class Stack extends MultiChildRenderObjectWidget {
void updateRenderObject(BuildContext context, RenderStack renderObject) { void updateRenderObject(BuildContext context, RenderStack renderObject) {
renderObject renderObject
..alignment = alignment ..alignment = alignment
..sizing = sizing ..fit = fit
..overflow = overflow; ..overflow = overflow;
} }
} }
...@@ -1710,7 +1710,7 @@ class IndexedStack extends Stack { ...@@ -1710,7 +1710,7 @@ class IndexedStack extends Stack {
StackFit sizing: StackFit.loose, StackFit sizing: StackFit.loose,
this.index: 0, this.index: 0,
List<Widget> children: const <Widget>[], List<Widget> children: const <Widget>[],
}) : super(key: key, alignment: alignment, sizing: sizing, children: children); }) : super(key: key, alignment: alignment, fit: sizing, children: children);
/// The index of the child to show. /// The index of the child to show.
final int index; final int index;
......
...@@ -362,7 +362,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin { ...@@ -362,7 +362,7 @@ class OverlayState extends State<Overlay> with TickerProviderStateMixin {
} }
return new _Theatre( return new _Theatre(
onstage: new Stack( onstage: new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: onstageChildren.reversed.toList(growable: false), children: onstageChildren.reversed.toList(growable: false),
), ),
offstage: offstageChildren, offstage: offstageChildren,
......
...@@ -22,7 +22,7 @@ void main() { ...@@ -22,7 +22,7 @@ void main() {
// //
await tester.pumpWidget( await tester.pumpWidget(
new Stack( new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
label: 'L1', label: 'L1',
...@@ -30,7 +30,7 @@ void main() { ...@@ -30,7 +30,7 @@ void main() {
new Semantics( new Semantics(
label: 'L2', label: 'L2',
child: new Stack( child: new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
checked: true, checked: true,
...@@ -78,7 +78,7 @@ void main() { ...@@ -78,7 +78,7 @@ void main() {
// //
await tester.pumpWidget( await tester.pumpWidget(
new Stack( new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
label: 'L1', label: 'L1',
...@@ -86,7 +86,7 @@ void main() { ...@@ -86,7 +86,7 @@ void main() {
new Semantics( new Semantics(
label: 'L2', label: 'L2',
child: new Stack( child: new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
checked: true, checked: true,
...@@ -122,13 +122,13 @@ void main() { ...@@ -122,13 +122,13 @@ void main() {
// //
await tester.pumpWidget( await tester.pumpWidget(
new Stack( new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics(), const Semantics(),
new Semantics( new Semantics(
label: 'L2', label: 'L2',
child: new Stack( child: new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
checked: true, checked: true,
......
...@@ -14,7 +14,7 @@ void main() { ...@@ -14,7 +14,7 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
new Stack( new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
// this tests that empty nodes disappear // this tests that empty nodes disappear
......
...@@ -19,7 +19,7 @@ void main() { ...@@ -19,7 +19,7 @@ void main() {
label = '1'; label = '1';
await tester.pumpWidget( await tester.pumpWidget(
new Stack( new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
new MergeSemantics( new MergeSemantics(
child: new Semantics( child: new Semantics(
...@@ -33,7 +33,7 @@ void main() { ...@@ -33,7 +33,7 @@ void main() {
), ),
new MergeSemantics( new MergeSemantics(
child: new Stack( child: new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
checked: true, checked: true,
...@@ -71,7 +71,7 @@ void main() { ...@@ -71,7 +71,7 @@ void main() {
label = '2'; label = '2';
await tester.pumpWidget( await tester.pumpWidget(
new Stack( new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
new MergeSemantics( new MergeSemantics(
child: new Semantics( child: new Semantics(
...@@ -85,7 +85,7 @@ void main() { ...@@ -85,7 +85,7 @@ void main() {
), ),
new MergeSemantics( new MergeSemantics(
child: new Stack( child: new Stack(
sizing: StackFit.expand, fit: StackFit.expand,
children: <Widget>[ children: <Widget>[
const Semantics( const Semantics(
checked: true, checked: true,
......
...@@ -383,7 +383,7 @@ void main() { ...@@ -383,7 +383,7 @@ void main() {
maxHeight: 7.0, maxHeight: 7.0,
), ),
child: new Stack( child: new Stack(
sizing: sizing, fit: sizing,
children: <Widget>[ children: <Widget>[
new LayoutBuilder( new LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) { builder: (BuildContext context, BoxConstraints constraints) {
......
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