[rename fixit] Flex alignments
* justifyContent -> mainAxisAlignment * alignItems -> crossAxisAlignment * FlexJustifyContent -> MainAxisAlignment * FlexAlignItems -> CrossAxisAlignment Fixes #231
This commit is contained in:
@@ -142,7 +142,7 @@ class AppBar extends StatelessWidget {
|
||||
Widget appBar = toolBar;
|
||||
if (tabBar != null) {
|
||||
appBar = new Column(
|
||||
justifyContent: FlexJustifyContent.collapse,
|
||||
mainAxisAlignment: MainAxisAlignment.collapse,
|
||||
children: <Widget>[toolBar, tabBar]
|
||||
);
|
||||
} else if (flexibleSpace != null) {
|
||||
|
||||
@@ -87,7 +87,7 @@ class Chip extends StatelessWidget {
|
||||
),
|
||||
child: new Row(
|
||||
children: children,
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -98,7 +98,7 @@ class _DatePickerState extends State<DatePicker> {
|
||||
child: picker
|
||||
)
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ class DayPicker extends StatelessWidget {
|
||||
new Text(new DateFormat("MMMM y").format(displayedMonth), style: monthStyle),
|
||||
new Flex(
|
||||
children: headers,
|
||||
justifyContent: FlexJustifyContent.spaceAround
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround
|
||||
)
|
||||
];
|
||||
int year = displayedMonth.year;
|
||||
|
||||
@@ -90,7 +90,7 @@ class Dialog extends StatelessWidget {
|
||||
child: new Container(
|
||||
child: new Row(
|
||||
children: actions,
|
||||
justifyContent: FlexJustifyContent.end
|
||||
mainAxisAlignment: MainAxisAlignment.end
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
@@ -304,7 +304,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
|
||||
padding: const EdgeInsets.only(top: 6.0)
|
||||
)
|
||||
],
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -53,7 +53,7 @@ class GridTileBar extends StatelessWidget {
|
||||
children.add(
|
||||
new Flexible(
|
||||
child: new Column(
|
||||
alignItems: FlexAlignItems.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new DefaultTextStyle(
|
||||
style: Typography.white.subhead,
|
||||
@@ -87,7 +87,7 @@ class GridTileBar extends StatelessWidget {
|
||||
child: new IconTheme(
|
||||
data: new IconThemeData(color: Colors.white),
|
||||
child: new Row(
|
||||
alignItems: FlexAlignItems.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: children
|
||||
)
|
||||
)
|
||||
|
||||
@@ -188,7 +188,7 @@ class _InputState extends State<Input> {
|
||||
double iconSize = config.isDense ? 18.0 : 24.0;
|
||||
double iconTop = topPadding + (textStyle.fontSize - iconSize) / 2.0;
|
||||
child = new Row(
|
||||
alignItems: FlexAlignItems.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
new Container(
|
||||
margin: new EdgeInsets.only(right: 16.0, top: iconTop),
|
||||
|
||||
@@ -121,8 +121,8 @@ class ListItem extends StatelessWidget {
|
||||
Widget center = primaryLine;
|
||||
if (isTwoLine || isThreeLine) {
|
||||
center = new Column(
|
||||
justifyContent: FlexJustifyContent.collapse,
|
||||
alignItems: FlexAlignItems.start,
|
||||
mainAxisAlignment: MainAxisAlignment.collapse,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
primaryLine,
|
||||
new DefaultTextStyle(
|
||||
@@ -153,7 +153,7 @@ class ListItem extends StatelessWidget {
|
||||
height: itemHeight,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
child: new Row(
|
||||
alignItems: FlexAlignItems.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: children
|
||||
)
|
||||
)
|
||||
|
||||
@@ -132,7 +132,7 @@ class SnackBar extends StatelessWidget {
|
||||
opacity: fadeAnimation,
|
||||
child: new Row(
|
||||
children: children,
|
||||
alignItems: FlexAlignItems.center
|
||||
crossAxisAlignment: CrossAxisAlignment.center
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -346,8 +346,8 @@ class _Tab extends StatelessWidget {
|
||||
),
|
||||
_buildLabelText()
|
||||
],
|
||||
justifyContent: FlexJustifyContent.center,
|
||||
alignItems: FlexAlignItems.center
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1010,7 +1010,7 @@ class TabPageSelector<T> extends StatelessWidget {
|
||||
label: 'Page ${selection.index + 1} of ${selection.values.length}',
|
||||
child: new Row(
|
||||
children: selection.values.map((T tab) => _buildTabIndicator(selection, tab, animation, selectedColor, previousColor)).toList(),
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class _TimePickerState extends State<TimePicker> {
|
||||
)
|
||||
)
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -223,12 +223,12 @@ class _TimePickerHeader extends StatelessWidget {
|
||||
child: new Text('PM', style: pmStyle)
|
||||
),
|
||||
],
|
||||
justifyContent: FlexJustifyContent.end
|
||||
mainAxisAlignment: MainAxisAlignment.end
|
||||
)
|
||||
)
|
||||
)
|
||||
],
|
||||
justifyContent: FlexJustifyContent.end
|
||||
mainAxisAlignment: MainAxisAlignment.end
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ enum FlexDirection {
|
||||
}
|
||||
|
||||
/// How the children should be placed along the main axis in a flex layout
|
||||
enum FlexJustifyContent {
|
||||
enum MainAxisAlignment {
|
||||
/// Place the children as close to the start of the main axis as possible
|
||||
start,
|
||||
/// Place the children as close to the end of the main axis as possible
|
||||
@@ -45,7 +45,7 @@ enum FlexJustifyContent {
|
||||
}
|
||||
|
||||
/// How the children should be placed along the cross axis in a flex layout
|
||||
enum FlexAlignItems {
|
||||
enum CrossAxisAlignment {
|
||||
/// Place the children as close to the start of the cross axis as possible
|
||||
start,
|
||||
/// Place the children as close to the end of the cross axis as possible
|
||||
@@ -70,23 +70,23 @@ typedef double _ChildSizingFunction(RenderBox child, BoxConstraints constraints)
|
||||
/// children. Otherwise, the flex expands to the maximum max-axis size and the
|
||||
/// remaining space along is divided among the flexible children according to
|
||||
/// their flex factors. Any remaining free space (i.e., if there aren't any
|
||||
/// flexible children) is allocated according to the [justifyContent] property.
|
||||
/// flexible children) is allocated according to the [mainAxisAlignment] property.
|
||||
///
|
||||
/// In the cross axis, children determine their own size. The flex then sizes
|
||||
/// its cross axis to fix the largest of its children. The children are then
|
||||
/// positioned along the cross axis according to the [alignItems] property.
|
||||
/// positioned along the cross axis according to the [crossAxisAlignment] property.
|
||||
class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, FlexParentData>,
|
||||
RenderBoxContainerDefaultsMixin<RenderBox, FlexParentData> {
|
||||
|
||||
RenderFlex({
|
||||
List<RenderBox> children,
|
||||
FlexDirection direction: FlexDirection.horizontal,
|
||||
FlexJustifyContent justifyContent: FlexJustifyContent.start,
|
||||
FlexAlignItems alignItems: FlexAlignItems.center,
|
||||
MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start,
|
||||
CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center,
|
||||
TextBaseline textBaseline
|
||||
}) : _direction = direction,
|
||||
_justifyContent = justifyContent,
|
||||
_alignItems = alignItems,
|
||||
_mainAxisAlignment = mainAxisAlignment,
|
||||
_crossAxisAlignment = crossAxisAlignment,
|
||||
_textBaseline = textBaseline {
|
||||
addAll(children);
|
||||
}
|
||||
@@ -102,21 +102,21 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
}
|
||||
|
||||
/// How the children should be placed along the main axis
|
||||
FlexJustifyContent get justifyContent => _justifyContent;
|
||||
FlexJustifyContent _justifyContent;
|
||||
void set justifyContent (FlexJustifyContent value) {
|
||||
if (_justifyContent != value) {
|
||||
_justifyContent = value;
|
||||
MainAxisAlignment get mainAxisAlignment => _mainAxisAlignment;
|
||||
MainAxisAlignment _mainAxisAlignment;
|
||||
void set mainAxisAlignment (MainAxisAlignment value) {
|
||||
if (_mainAxisAlignment != value) {
|
||||
_mainAxisAlignment = value;
|
||||
markNeedsLayout();
|
||||
}
|
||||
}
|
||||
|
||||
/// How the children should be placed along the cross axis
|
||||
FlexAlignItems get alignItems => _alignItems;
|
||||
FlexAlignItems _alignItems;
|
||||
void set alignItems (FlexAlignItems value) {
|
||||
if (_alignItems != value) {
|
||||
_alignItems = value;
|
||||
CrossAxisAlignment get crossAxisAlignment => _crossAxisAlignment;
|
||||
CrossAxisAlignment _crossAxisAlignment;
|
||||
void set crossAxisAlignment (CrossAxisAlignment value) {
|
||||
if (_crossAxisAlignment != value) {
|
||||
_crossAxisAlignment = value;
|
||||
markNeedsLayout();
|
||||
}
|
||||
}
|
||||
@@ -336,7 +336,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
int totalChildren = 0;
|
||||
assert(constraints != null);
|
||||
final double mainSize = (_direction == FlexDirection.horizontal) ? constraints.constrainWidth() : constraints.constrainHeight();
|
||||
final bool canFlex = mainSize < double.INFINITY && justifyContent != FlexJustifyContent.collapse;
|
||||
final bool canFlex = mainSize < double.INFINITY && mainAxisAlignment != MainAxisAlignment.collapse;
|
||||
double crossSize = 0.0; // This is determined as we lay out the children
|
||||
double freeSpace = canFlex ? mainSize : 0.0;
|
||||
RenderBox child = firstChild;
|
||||
@@ -352,7 +352,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
totalFlex += childParentData.flex;
|
||||
} else {
|
||||
BoxConstraints innerConstraints;
|
||||
if (alignItems == FlexAlignItems.stretch) {
|
||||
if (crossAxisAlignment == CrossAxisAlignment.stretch) {
|
||||
switch (_direction) {
|
||||
case FlexDirection.horizontal:
|
||||
innerConstraints = new BoxConstraints(minHeight: constraints.maxHeight,
|
||||
@@ -386,7 +386,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
// Distribute remaining space to flexible children, and determine baseline.
|
||||
double maxBaselineDistance = 0.0;
|
||||
double usedSpace = 0.0;
|
||||
if (totalFlex > 0 || alignItems == FlexAlignItems.baseline) {
|
||||
if (totalFlex > 0 || crossAxisAlignment == CrossAxisAlignment.baseline) {
|
||||
double spacePerFlex = totalFlex > 0 ? (freeSpace / totalFlex) : 0.0;
|
||||
child = firstChild;
|
||||
while (child != null) {
|
||||
@@ -394,7 +394,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
if (flex > 0) {
|
||||
double spaceForChild = spacePerFlex * flex;
|
||||
BoxConstraints innerConstraints;
|
||||
if (alignItems == FlexAlignItems.stretch) {
|
||||
if (crossAxisAlignment == CrossAxisAlignment.stretch) {
|
||||
switch (_direction) {
|
||||
case FlexDirection.horizontal:
|
||||
innerConstraints = new BoxConstraints(minWidth: spaceForChild,
|
||||
@@ -427,7 +427,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
usedSpace += _getMainSize(child);
|
||||
crossSize = math.max(crossSize, _getCrossSize(child));
|
||||
}
|
||||
if (alignItems == FlexAlignItems.baseline) {
|
||||
if (crossAxisAlignment == CrossAxisAlignment.baseline) {
|
||||
assert(textBaseline != null && 'To use FlexAlignItems.baseline, you must also specify which baseline to use using the "baseline" argument.' is String);
|
||||
double distance = child.getDistanceToBaseline(textBaseline, onlyReal: true);
|
||||
if (distance != null)
|
||||
@@ -473,25 +473,25 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
}
|
||||
_overflow = 0.0;
|
||||
}
|
||||
switch (_justifyContent) {
|
||||
case FlexJustifyContent.start:
|
||||
case FlexJustifyContent.collapse:
|
||||
switch (_mainAxisAlignment) {
|
||||
case MainAxisAlignment.start:
|
||||
case MainAxisAlignment.collapse:
|
||||
leadingSpace = 0.0;
|
||||
betweenSpace = 0.0;
|
||||
break;
|
||||
case FlexJustifyContent.end:
|
||||
case MainAxisAlignment.end:
|
||||
leadingSpace = remainingSpace;
|
||||
betweenSpace = 0.0;
|
||||
break;
|
||||
case FlexJustifyContent.center:
|
||||
case MainAxisAlignment.center:
|
||||
leadingSpace = remainingSpace / 2.0;
|
||||
betweenSpace = 0.0;
|
||||
break;
|
||||
case FlexJustifyContent.spaceBetween:
|
||||
case MainAxisAlignment.spaceBetween:
|
||||
leadingSpace = 0.0;
|
||||
betweenSpace = totalChildren > 1 ? remainingSpace / (totalChildren - 1) : 0.0;
|
||||
break;
|
||||
case FlexJustifyContent.spaceAround:
|
||||
case MainAxisAlignment.spaceAround:
|
||||
betweenSpace = totalChildren > 0 ? remainingSpace / totalChildren : 0.0;
|
||||
leadingSpace = betweenSpace / 2.0;
|
||||
break;
|
||||
@@ -503,18 +503,18 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
while (child != null) {
|
||||
final FlexParentData childParentData = child.parentData;
|
||||
double childCrossPosition;
|
||||
switch (_alignItems) {
|
||||
case FlexAlignItems.stretch:
|
||||
case FlexAlignItems.start:
|
||||
switch (_crossAxisAlignment) {
|
||||
case CrossAxisAlignment.stretch:
|
||||
case CrossAxisAlignment.start:
|
||||
childCrossPosition = 0.0;
|
||||
break;
|
||||
case FlexAlignItems.end:
|
||||
case CrossAxisAlignment.end:
|
||||
childCrossPosition = crossSize - _getCrossSize(child);
|
||||
break;
|
||||
case FlexAlignItems.center:
|
||||
case CrossAxisAlignment.center:
|
||||
childCrossPosition = crossSize / 2.0 - _getCrossSize(child) / 2.0;
|
||||
break;
|
||||
case FlexAlignItems.baseline:
|
||||
case CrossAxisAlignment.baseline:
|
||||
childCrossPosition = 0.0;
|
||||
if (_direction == FlexDirection.horizontal) {
|
||||
assert(textBaseline != null);
|
||||
@@ -595,8 +595,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
|
||||
void debugFillDescription(List<String> description) {
|
||||
super.debugFillDescription(description);
|
||||
description.add('direction: $_direction');
|
||||
description.add('justifyContent: $_justifyContent');
|
||||
description.add('alignItems: $_alignItems');
|
||||
description.add('mainAxisAlignment: $_mainAxisAlignment');
|
||||
description.add('crossAxisAlignment: $_crossAxisAlignment');
|
||||
description.add('textBaseline: $_textBaseline');
|
||||
}
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ export 'package:flutter/rendering.dart' show
|
||||
CustomClipper,
|
||||
CustomPainter,
|
||||
FixedColumnCountGridDelegate,
|
||||
FlexAlignItems,
|
||||
CrossAxisAlignment,
|
||||
FlexDirection,
|
||||
FlexJustifyContent,
|
||||
MainAxisAlignment,
|
||||
FractionalOffsetTween,
|
||||
GridDelegate,
|
||||
GridDelegateWithInOrderChildPlacement,
|
||||
@@ -1355,27 +1355,27 @@ class Flex extends MultiChildRenderObjectWidget {
|
||||
Key key,
|
||||
List<Widget> children: _emptyWidgetList,
|
||||
this.direction: FlexDirection.horizontal,
|
||||
this.justifyContent: FlexJustifyContent.start,
|
||||
this.alignItems: FlexAlignItems.center,
|
||||
this.mainAxisAlignment: MainAxisAlignment.start,
|
||||
this.crossAxisAlignment: CrossAxisAlignment.center,
|
||||
this.textBaseline
|
||||
}) : super(key: key, children: children) {
|
||||
assert(direction != null);
|
||||
assert(justifyContent != null);
|
||||
assert(alignItems != null);
|
||||
assert(mainAxisAlignment != null);
|
||||
assert(crossAxisAlignment != null);
|
||||
}
|
||||
|
||||
final FlexDirection direction;
|
||||
final FlexJustifyContent justifyContent;
|
||||
final FlexAlignItems alignItems;
|
||||
final MainAxisAlignment mainAxisAlignment;
|
||||
final CrossAxisAlignment crossAxisAlignment;
|
||||
final TextBaseline textBaseline;
|
||||
|
||||
RenderFlex createRenderObject(BuildContext context) => new RenderFlex(direction: direction, justifyContent: justifyContent, alignItems: alignItems, textBaseline: textBaseline);
|
||||
RenderFlex createRenderObject(BuildContext context) => new RenderFlex(direction: direction, mainAxisAlignment: mainAxisAlignment, crossAxisAlignment: crossAxisAlignment, textBaseline: textBaseline);
|
||||
|
||||
void updateRenderObject(BuildContext context, RenderFlex renderObject) {
|
||||
renderObject
|
||||
..direction = direction
|
||||
..justifyContent = justifyContent
|
||||
..alignItems = alignItems
|
||||
..mainAxisAlignment = mainAxisAlignment
|
||||
..crossAxisAlignment = crossAxisAlignment
|
||||
..textBaseline = textBaseline;
|
||||
}
|
||||
}
|
||||
@@ -1388,15 +1388,15 @@ class Row extends Flex {
|
||||
Row({
|
||||
Key key,
|
||||
List<Widget> children: _emptyWidgetList,
|
||||
FlexJustifyContent justifyContent: FlexJustifyContent.start,
|
||||
FlexAlignItems alignItems: FlexAlignItems.center,
|
||||
MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start,
|
||||
CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center,
|
||||
TextBaseline textBaseline
|
||||
}) : super(
|
||||
children: children,
|
||||
key: key,
|
||||
direction: FlexDirection.horizontal,
|
||||
justifyContent: justifyContent,
|
||||
alignItems: alignItems,
|
||||
mainAxisAlignment: mainAxisAlignment,
|
||||
crossAxisAlignment: crossAxisAlignment,
|
||||
textBaseline: textBaseline
|
||||
);
|
||||
}
|
||||
@@ -1409,15 +1409,15 @@ class Column extends Flex {
|
||||
Column({
|
||||
Key key,
|
||||
List<Widget> children: _emptyWidgetList,
|
||||
FlexJustifyContent justifyContent: FlexJustifyContent.start,
|
||||
FlexAlignItems alignItems: FlexAlignItems.center,
|
||||
MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start,
|
||||
CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center,
|
||||
TextBaseline textBaseline
|
||||
}) : super(
|
||||
children: children,
|
||||
key: key,
|
||||
direction: FlexDirection.vertical,
|
||||
justifyContent: justifyContent,
|
||||
alignItems: alignItems,
|
||||
mainAxisAlignment: mainAxisAlignment,
|
||||
crossAxisAlignment: crossAxisAlignment,
|
||||
textBaseline: textBaseline
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void main() {
|
||||
RenderBox flex = new RenderFlex(
|
||||
children: <RenderBox>[padding],
|
||||
direction: FlexDirection.vertical,
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
);
|
||||
RenderBox outer = new RenderDecoratedBox(
|
||||
decoration: new BoxDecoration(
|
||||
|
||||
@@ -80,7 +80,7 @@ void main() {
|
||||
|
||||
test('Defaults', () {
|
||||
RenderFlex flex = new RenderFlex();
|
||||
expect(flex.alignItems, equals(FlexAlignItems.center));
|
||||
expect(flex.crossAxisAlignment, equals(CrossAxisAlignment.center));
|
||||
expect(flex.direction, equals(FlexDirection.horizontal));
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ void main() {
|
||||
expect(box2.size.width, equals(100.0));
|
||||
expect(box2.size.height, equals(0.0));
|
||||
|
||||
flex.alignItems = FlexAlignItems.stretch;
|
||||
flex.crossAxisAlignment = CrossAxisAlignment.stretch;
|
||||
pumpFrame();
|
||||
expect(box1.size.width, equals(0.0));
|
||||
expect(box1.size.height, equals(100.0));
|
||||
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
test('Row, Column and FlexJustifyContent.collapse', () {
|
||||
final Key flexKey = new Key('flexKey');
|
||||
|
||||
// Row without justifyContent: FlexJustifyContent.collapse
|
||||
// Row without mainAxisAlignment: FlexJustifyContent.collapse
|
||||
testWidgets((WidgetTester tester) {
|
||||
tester.pumpWidget(new Center(
|
||||
child: new Row(
|
||||
@@ -69,7 +69,7 @@ void main() {
|
||||
expect(renderBox.size.width, equals(800.0));
|
||||
expect(renderBox.size.height, equals(100.0));
|
||||
|
||||
// Row with justifyContent: FlexJustifyContent.collapse
|
||||
// Row with mainAxisAlignment: FlexJustifyContent.collapse
|
||||
tester.pumpWidget(new Center(
|
||||
child: new Row(
|
||||
children: <Widget>[
|
||||
@@ -77,7 +77,7 @@ void main() {
|
||||
new Container(width: 30.0, height: 100.0)
|
||||
],
|
||||
key: flexKey,
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
));
|
||||
renderBox = tester.findElementByKey(flexKey).renderObject;
|
||||
@@ -85,7 +85,7 @@ void main() {
|
||||
expect(renderBox.size.height, equals(100.0));
|
||||
});
|
||||
|
||||
// Column without justifyContent: FlexJustifyContent.collapse
|
||||
// Column without mainAxisAlignment: FlexJustifyContent.collapse
|
||||
testWidgets((WidgetTester tester) {
|
||||
tester.pumpWidget(new Center(
|
||||
child: new Column(
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
expect(renderBox.size.width, equals(100.0));
|
||||
expect(renderBox.size.height, equals(600.0));
|
||||
|
||||
// Column with justifyContent: FlexJustifyContent.collapse
|
||||
// Column with mainAxisAlignment: FlexJustifyContent.collapse
|
||||
tester.pumpWidget(new Center(
|
||||
child: new Column(
|
||||
children: <Widget>[
|
||||
@@ -108,7 +108,7 @@ void main() {
|
||||
new Container(width: 100.0, height: 150.0)
|
||||
],
|
||||
key: flexKey,
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
));
|
||||
renderBox = tester.findElementByKey(flexKey).renderObject;
|
||||
@@ -133,7 +133,7 @@ void main() {
|
||||
height: 100.0
|
||||
)
|
||||
],
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
)
|
||||
));
|
||||
@@ -154,7 +154,7 @@ void main() {
|
||||
height: 100.0
|
||||
)
|
||||
],
|
||||
justifyContent: FlexJustifyContent.collapse
|
||||
mainAxisAlignment: MainAxisAlignment.collapse
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
@@ -18,7 +18,7 @@ void main() {
|
||||
key: rotatedBoxKey,
|
||||
quarterTurns: 1,
|
||||
child: new Row(
|
||||
justifyContent: FlexJustifyContent.collapse,
|
||||
mainAxisAlignment: MainAxisAlignment.collapse,
|
||||
children: <Widget>[
|
||||
new GestureDetector(
|
||||
onTap: () { log.add('left'); },
|
||||
|
||||
@@ -58,7 +58,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
@@ -95,7 +95,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
@@ -160,7 +160,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
@@ -197,7 +197,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
|
||||
@@ -35,7 +35,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
@@ -137,7 +137,7 @@ void main() {
|
||||
)
|
||||
),
|
||||
],
|
||||
alignItems: FlexAlignItems.stretch
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch
|
||||
)
|
||||
);
|
||||
expect(client.updates.length, equals(2));
|
||||
|
||||
@@ -172,7 +172,7 @@ class _MarkdownBodyRawState extends State<MarkdownBodyRaw> {
|
||||
}
|
||||
|
||||
return new Column(
|
||||
alignItems: FlexAlignItems.stretch,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: blocks
|
||||
);
|
||||
}
|
||||
@@ -365,7 +365,7 @@ class _Block {
|
||||
}
|
||||
|
||||
contents = new Column(
|
||||
alignItems: FlexAlignItems.stretch,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: subWidgets
|
||||
);
|
||||
} else {
|
||||
@@ -391,7 +391,7 @@ class _Block {
|
||||
}
|
||||
|
||||
contents = new Row(
|
||||
alignItems: FlexAlignItems.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
new SizedBox(
|
||||
width: listIndents.length * markdownStyle.listIndent,
|
||||
|
||||
Reference in New Issue
Block a user