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