Commit d5b2e2a0 authored by Adam Barth's avatar Adam Barth

[rename fixit] Flex alignments

* justifyContent -> mainAxisAlignment
* alignItems -> crossAxisAlignment
* FlexJustifyContent -> MainAxisAlignment
* FlexAlignItems -> CrossAxisAlignment

Fixes #231
parent 5e1af2f3
...@@ -325,8 +325,8 @@ class CardCollectionState extends State<CardCollection> { ...@@ -325,8 +325,8 @@ class CardCollectionState extends State<CardCollection> {
children: <Widget>[ children: <Widget>[
new Text(cardModel.inputValue.text) new Text(cardModel.inputValue.text)
], ],
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
justifyContent: FlexJustifyContent.center mainAxisAlignment: MainAxisAlignment.center
) )
) )
) )
......
...@@ -250,8 +250,8 @@ class DragAndDropAppState extends State<DragAndDropApp> { ...@@ -250,8 +250,8 @@ class DragAndDropAppState extends State<DragAndDropApp> {
child: new Text('above') child: new Text('above')
), ),
], ],
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
) )
), ),
new Flexible( new Flexible(
...@@ -271,7 +271,7 @@ class DragAndDropAppState extends State<DragAndDropApp> { ...@@ -271,7 +271,7 @@ class DragAndDropAppState extends State<DragAndDropApp> {
new MovableBall(2, position, moveBall), new MovableBall(2, position, moveBall),
new MovableBall(3, position, moveBall), new MovableBall(3, position, moveBall),
], ],
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
) )
), ),
] ]
......
...@@ -182,7 +182,7 @@ class Launcher extends StatelessWidget { ...@@ -182,7 +182,7 @@ class Launcher extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Row( return new Row(
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
children: items children: items
); );
} }
......
...@@ -67,7 +67,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> { ...@@ -67,7 +67,7 @@ class _HardwareKeyDemoState extends State<RawKeyboardDemo> {
new Text('${_event.type}', style: Typography.black.body2), new Text('${_event.type}', style: Typography.black.body2),
new Text('${_event.keyData.keyCode}', style: Typography.black.display4) new Text('${_event.keyData.keyCode}', style: Typography.black.display4)
], ],
justifyContent: FlexJustifyContent.center mainAxisAlignment: MainAxisAlignment.center
); );
} }
return new RawKeyboardListener( return new RawKeyboardListener(
......
...@@ -12,11 +12,11 @@ import 'src/solid_color_box.dart'; ...@@ -12,11 +12,11 @@ import 'src/solid_color_box.dart';
void main() { void main() {
RenderFlex table = new RenderFlex(direction: FlexDirection.vertical); RenderFlex table = new RenderFlex(direction: FlexDirection.vertical);
void addAlignmentRow(FlexAlignItems alignItems) { void addAlignmentRow(CrossAxisAlignment crossAxisAlignment) {
TextStyle style = const TextStyle(color: const Color(0xFF000000)); TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$alignItems')); RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$crossAxisAlignment'));
table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0))); table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0)));
RenderFlex row = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic); RenderFlex row = new RenderFlex(crossAxisAlignment: crossAxisAlignment, textBaseline: TextBaseline.alphabetic);
style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000)); style = new TextStyle(fontSize: 15.0, color: const Color(0xFF000000));
row.add(new RenderDecoratedBox( row.add(new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0x7FFFCCCC)), decoration: new BoxDecoration(backgroundColor: const Color(0x7FFFCCCC)),
...@@ -27,7 +27,7 @@ void main() { ...@@ -27,7 +27,7 @@ void main() {
decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCFFCC)), decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCFFCC)),
child: new RenderParagraph(new TextSpan(style: style, text: 'foo foo foo')) child: new RenderParagraph(new TextSpan(style: style, text: 'foo foo foo'))
)); ));
RenderFlex subrow = new RenderFlex(alignItems: alignItems, textBaseline: TextBaseline.alphabetic); RenderFlex subrow = new RenderFlex(crossAxisAlignment: crossAxisAlignment, textBaseline: TextBaseline.alphabetic);
style = new TextStyle(fontSize: 25.0, color: const Color(0xFF000000)); style = new TextStyle(fontSize: 25.0, color: const Color(0xFF000000));
subrow.add(new RenderDecoratedBox( subrow.add(new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCCCFF)), decoration: new BoxDecoration(backgroundColor: const Color(0x7FCCCCFF)),
...@@ -40,13 +40,13 @@ void main() { ...@@ -40,13 +40,13 @@ void main() {
rowParentData.flex = 1; rowParentData.flex = 1;
} }
addAlignmentRow(FlexAlignItems.start); addAlignmentRow(CrossAxisAlignment.start);
addAlignmentRow(FlexAlignItems.end); addAlignmentRow(CrossAxisAlignment.end);
addAlignmentRow(FlexAlignItems.center); addAlignmentRow(CrossAxisAlignment.center);
addAlignmentRow(FlexAlignItems.stretch); addAlignmentRow(CrossAxisAlignment.stretch);
addAlignmentRow(FlexAlignItems.baseline); addAlignmentRow(CrossAxisAlignment.baseline);
void addJustificationRow(FlexJustifyContent justify) { void addJustificationRow(MainAxisAlignment justify) {
const TextStyle style = const TextStyle(color: const Color(0xFF000000)); const TextStyle style = const TextStyle(color: const Color(0xFF000000));
RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$justify')); RenderParagraph paragraph = new RenderParagraph(new TextSpan(style: style, text: '$justify'));
table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0))); table.add(new RenderPadding(child: paragraph, padding: new EdgeInsets.only(top: 20.0)));
...@@ -54,17 +54,17 @@ void main() { ...@@ -54,17 +54,17 @@ void main() {
row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0))); row.add(new RenderSolidColorBox(const Color(0xFFFFCCCC), desiredSize: new Size(80.0, 60.0)));
row.add(new RenderSolidColorBox(const Color(0xFFCCFFCC), desiredSize: new Size(64.0, 60.0))); row.add(new RenderSolidColorBox(const Color(0xFFCCFFCC), desiredSize: new Size(64.0, 60.0)));
row.add(new RenderSolidColorBox(const Color(0xFFCCCCFF), desiredSize: new Size(160.0, 60.0))); row.add(new RenderSolidColorBox(const Color(0xFFCCCCFF), desiredSize: new Size(160.0, 60.0)));
row.justifyContent = justify; row.mainAxisAlignment = justify;
table.add(row); table.add(row);
final FlexParentData rowParentData = row.parentData; final FlexParentData rowParentData = row.parentData;
rowParentData.flex = 1; rowParentData.flex = 1;
} }
addJustificationRow(FlexJustifyContent.start); addJustificationRow(MainAxisAlignment.start);
addJustificationRow(FlexJustifyContent.end); addJustificationRow(MainAxisAlignment.end);
addJustificationRow(FlexJustifyContent.center); addJustificationRow(MainAxisAlignment.center);
addJustificationRow(FlexJustifyContent.spaceBetween); addJustificationRow(MainAxisAlignment.spaceBetween);
addJustificationRow(FlexJustifyContent.spaceAround); addJustificationRow(MainAxisAlignment.spaceAround);
RenderDecoratedBox root = new RenderDecoratedBox( RenderDecoratedBox root = new RenderDecoratedBox(
decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)), decoration: new BoxDecoration(backgroundColor: const Color(0xFFFFFFFF)),
......
...@@ -201,7 +201,7 @@ class _GestureDemoState extends State<GestureDemo> { ...@@ -201,7 +201,7 @@ class _GestureDemoState extends State<GestureDemo> {
] ]
), ),
], ],
alignItems: FlexAlignItems.start crossAxisAlignment: CrossAxisAlignment.start
) )
) )
) )
......
...@@ -126,7 +126,7 @@ class SectorAppState extends State<SectorApp> { ...@@ -126,7 +126,7 @@ class SectorAppState extends State<SectorApp> {
) )
), ),
], ],
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
) )
), ),
new Flexible( new Flexible(
...@@ -143,7 +143,7 @@ class SectorAppState extends State<SectorApp> { ...@@ -143,7 +143,7 @@ class SectorAppState extends State<SectorApp> {
) )
), ),
], ],
justifyContent: FlexJustifyContent.spaceBetween mainAxisAlignment: MainAxisAlignment.spaceBetween
); );
} }
......
...@@ -58,13 +58,13 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) { ...@@ -58,13 +58,13 @@ void attachWidgetTreeToRenderTree(RenderProxyBox container) {
), ),
new CircularProgressIndicator(value: value), new CircularProgressIndicator(value: value),
], ],
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
) )
) )
), ),
new Rectangle(const Color(0xFFFFFF00)), new Rectangle(const Color(0xFFFFFF00)),
], ],
justifyContent: FlexJustifyContent.spaceBetween mainAxisAlignment: MainAxisAlignment.spaceBetween
) )
) )
).attachToRenderTree(element); ).attachToRenderTree(element);
......
...@@ -107,8 +107,8 @@ class _StyledTextDemoState extends State<StyledTextDemo> { ...@@ -107,8 +107,8 @@ class _StyledTextDemoState extends State<StyledTextDemo> {
padding: new EdgeInsets.symmetric(horizontal: 8.0), padding: new EdgeInsets.symmetric(horizontal: 8.0),
child: new Column( child: new Column(
children: children, children: children,
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
alignItems: FlexAlignItems.start crossAxisAlignment: CrossAxisAlignment.start
) )
) )
); );
......
...@@ -179,7 +179,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> { ...@@ -179,7 +179,7 @@ class _ButtonsDemoState extends State<ButtonsDemo> {
builder: (BuildContext context) { builder: (BuildContext context) {
final TextStyle textStyle = Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0); final TextStyle textStyle = Theme.of(context).textTheme.caption.copyWith(fontSize: 16.0);
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
demo.builder(context), demo.builder(context),
new Padding( new Padding(
......
...@@ -82,8 +82,8 @@ class TravelDestinationItem extends StatelessWidget { ...@@ -82,8 +82,8 @@ class TravelDestinationItem extends StatelessWidget {
child: new Padding( child: new Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: new Column( child: new Column(
justifyContent: FlexJustifyContent.start, mainAxisAlignment: MainAxisAlignment.start,
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// three line description // three line description
new Text(destination.description[0], style: descriptionStyle), new Text(destination.description[0], style: descriptionStyle),
...@@ -92,8 +92,8 @@ class TravelDestinationItem extends StatelessWidget { ...@@ -92,8 +92,8 @@ class TravelDestinationItem extends StatelessWidget {
// share, explore buttons // share, explore buttons
new Flexible( new Flexible(
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.start, mainAxisAlignment: MainAxisAlignment.start,
alignItems: FlexAlignItems.end, crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[ children: <Widget>[
new Padding( new Padding(
padding: const EdgeInsets.only(right: 16.0), padding: const EdgeInsets.only(right: 16.0),
......
...@@ -60,8 +60,8 @@ class ColorItem extends StatelessWidget { ...@@ -60,8 +60,8 @@ class ColorItem extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
decoration: new BoxDecoration(backgroundColor: color), decoration: new BoxDecoration(backgroundColor: color),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text('$prefix$index'), new Text('$prefix$index'),
new Text(colorString()) new Text(colorString())
......
...@@ -40,7 +40,7 @@ class _DatePickerDemoState extends State<DatePickerDemo> { ...@@ -40,7 +40,7 @@ class _DatePickerDemoState extends State<DatePickerDemo> {
child: new Text('SELECT DATE') child: new Text('SELECT DATE')
), ),
], ],
justifyContent: FlexJustifyContent.center mainAxisAlignment: MainAxisAlignment.center
) )
); );
} }
......
...@@ -34,8 +34,8 @@ class DialogDemoItem extends StatelessWidget { ...@@ -34,8 +34,8 @@ class DialogDemoItem extends StatelessWidget {
child: new Padding( child: new Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.start, mainAxisAlignment: MainAxisAlignment.start,
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Icon( new Icon(
size: 36.0, size: 36.0,
......
...@@ -93,7 +93,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> { ...@@ -93,7 +93,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
return new Material( return new Material(
child: new Column( child: new Column(
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
child: new Container( child: new Container(
...@@ -108,7 +108,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> { ...@@ -108,7 +108,7 @@ class _FitnessDemoContentsState extends State<_FitnessDemoContents> {
new Padding( new Padding(
padding: new EdgeInsets.only(top: 20.0, bottom: 20.0), padding: new EdgeInsets.only(top: 20.0, bottom: 20.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
_createInfoPanelCell(Icons.accessibility, '$count', 'COUNT'), _createInfoPanelCell(Icons.accessibility, '$count', 'COUNT'),
_createInfoPanelCell(Icons.timer, _formatSeconds(time), 'TIME'), _createInfoPanelCell(Icons.timer, _formatSeconds(time), 'TIME'),
......
...@@ -47,7 +47,7 @@ class _ContactItem extends StatelessWidget { ...@@ -47,7 +47,7 @@ class _ContactItem extends StatelessWidget {
List<Widget> rowChildren = <Widget>[ List<Widget> rowChildren = <Widget>[
new Column( new Column(
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: columnChildren children: columnChildren
) )
]; ];
...@@ -60,7 +60,7 @@ class _ContactItem extends StatelessWidget { ...@@ -60,7 +60,7 @@ class _ContactItem extends StatelessWidget {
return new Padding( return new Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0), padding: const EdgeInsets.symmetric(vertical: 16.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: rowChildren children: rowChildren
) )
); );
......
...@@ -53,7 +53,7 @@ class DateTimeItem extends StatelessWidget { ...@@ -53,7 +53,7 @@ class DateTimeItem extends StatelessWidget {
}); });
}, },
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
new Text(new DateFormat('EEE, MMM d yyyy').format(date)), new Text(new DateFormat('EEE, MMM d yyyy').format(date)),
new Icon(icon: Icons.arrow_drop_down, color: Colors.black54), new Icon(icon: Icons.arrow_drop_down, color: Colors.black54),
...@@ -160,8 +160,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -160,8 +160,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: new ScrollableViewport( child: new ScrollableViewport(
child: new Column( child: new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
justifyContent: FlexJustifyContent.collapse, mainAxisAlignment: MainAxisAlignment.collapse,
children: <Widget>[ children: <Widget>[
new Container( new Container(
padding: const EdgeInsets.symmetric(vertical: 8.0), padding: const EdgeInsets.symmetric(vertical: 8.0),
...@@ -184,8 +184,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -184,8 +184,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
) )
), ),
new Column( new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
justifyContent: FlexJustifyContent.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
new Text('From', style: theme.textTheme.caption), new Text('From', style: theme.textTheme.caption),
new DateTimeItem( new DateTimeItem(
...@@ -200,8 +200,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> { ...@@ -200,8 +200,8 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
] ]
), ),
new Column( new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
justifyContent: FlexJustifyContent.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
new Text('To', style: theme.textTheme.caption), new Text('To', style: theme.textTheme.caption),
new DateTimeItem( new DateTimeItem(
......
...@@ -76,13 +76,13 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -76,13 +76,13 @@ class IconsDemoState extends State<IconsDemo> {
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
new Row( new Row(
justifyContent: FlexJustifyContent.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
flex: 0, flex: 0,
child: new Column( child: new Column(
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text('Size', style: textStyle), new Text('Size', style: textStyle),
buildSizeLabel(18, textStyle), buildSizeLabel(18, textStyle),
...@@ -94,7 +94,7 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -94,7 +94,7 @@ class IconsDemoState extends State<IconsDemo> {
), ),
new Flexible( new Flexible(
child: new Column( child: new Column(
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text('Enabled', style: textStyle), new Text('Enabled', style: textStyle),
buildIconButton(18.0, Icons.face, true), buildIconButton(18.0, Icons.face, true),
...@@ -106,7 +106,7 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -106,7 +106,7 @@ class IconsDemoState extends State<IconsDemo> {
), ),
new Flexible( new Flexible(
child: new Column( child: new Column(
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text('Disabled', style: textStyle), new Text('Disabled', style: textStyle),
buildIconButton(18.0, Icons.face, false), buildIconButton(18.0, Icons.face, false),
...@@ -123,7 +123,7 @@ class IconsDemoState extends State<IconsDemo> { ...@@ -123,7 +123,7 @@ class IconsDemoState extends State<IconsDemo> {
child: new IconTheme( child: new IconTheme(
data: new IconThemeData(opacity: 1.0), data: new IconThemeData(opacity: 1.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Icon( new Icon(
icon: Icons.brightness_7, icon: Icons.brightness_7,
......
...@@ -44,8 +44,8 @@ class ListDemoState extends State<ListDemo> { ...@@ -44,8 +44,8 @@ class ListDemoState extends State<ListDemo> {
border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0)) border: new Border(top: new BorderSide(color: Colors.black26, width: 1.0))
), ),
child: new Column( child: new Column(
justifyContent: FlexJustifyContent.collapse, mainAxisAlignment: MainAxisAlignment.collapse,
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
new ListItem( new ListItem(
dense: true, dense: true,
......
...@@ -49,7 +49,7 @@ class PageSelectorDemo extends StatelessWidget { ...@@ -49,7 +49,7 @@ class PageSelectorDemo extends StatelessWidget {
tooltip: 'Forward' tooltip: 'Forward'
) )
], ],
justifyContent: FlexJustifyContent.spaceBetween mainAxisAlignment: MainAxisAlignment.spaceBetween
) )
), ),
new Flexible( new Flexible(
......
...@@ -77,7 +77,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> { ...@@ -77,7 +77,7 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> {
children: indicators children: indicators
.map((Widget c) => new Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0))) .map((Widget c) => new Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0)))
.toList(), .toList(),
justifyContent: FlexJustifyContent.center mainAxisAlignment: MainAxisAlignment.center
); );
} }
......
...@@ -28,7 +28,7 @@ class _BarGraphic extends StatelessWidget { ...@@ -28,7 +28,7 @@ class _BarGraphic extends StatelessWidget {
child: new DefaultTextStyle( child: new DefaultTextStyle(
style: Theme.of(context).textTheme.body1.copyWith(color: Colors.white), style: Theme.of(context).textTheme.body1.copyWith(color: Colors.white),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
new Text(leftText), new Text(leftText),
new Text(rightText) new Text(rightText)
...@@ -92,7 +92,7 @@ class _TechniqueItem extends StatelessWidget { ...@@ -92,7 +92,7 @@ class _TechniqueItem extends StatelessWidget {
child: new Padding( child: new Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children :<Widget>[ children :<Widget>[
new Text(titleText), new Text(titleText),
new Column(children: barGraphics) new Column(children: barGraphics)
......
...@@ -35,7 +35,7 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -35,7 +35,7 @@ class _SliderDemoState extends State<SliderDemo> {
child: new Text(_value.round().toString().padLeft(3, '0')) child: new Text(_value.round().toString().padLeft(3, '0'))
), ),
], ],
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
) )
), ),
...@@ -51,7 +51,7 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -51,7 +51,7 @@ class _SliderDemoState extends State<SliderDemo> {
child: new Text((_value / 100.0).toStringAsFixed(2)) child: new Text((_value / 100.0).toStringAsFixed(2))
), ),
], ],
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
) )
) )
......
...@@ -85,7 +85,7 @@ class TextFieldDemoState extends State<TextFieldDemo> { ...@@ -85,7 +85,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
onSubmitted: _handleInputSubmitted onSubmitted: _handleInputSubmitted
), ),
new Row( new Row(
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
new Flexible( new Flexible(
child: new Input( child: new Input(
......
...@@ -36,7 +36,7 @@ class _TimePickerDemoState extends State<TimePickerDemo> { ...@@ -36,7 +36,7 @@ class _TimePickerDemoState extends State<TimePickerDemo> {
child: new Text('SELECT TIME') child: new Text('SELECT TIME')
), ),
], ],
justifyContent: FlexJustifyContent.center mainAxisAlignment: MainAxisAlignment.center
) )
); );
} }
......
...@@ -42,7 +42,7 @@ class _ToggleControlsDemoState extends State<ToggleControlsDemo> { ...@@ -42,7 +42,7 @@ class _ToggleControlsDemoState extends State<ToggleControlsDemo> {
new Checkbox(value: false), // Disabled new Checkbox(value: false), // Disabled
new Checkbox(value: true), // Disabled new Checkbox(value: true), // Disabled
], ],
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
), ),
new Row( new Row(
children: <int>[0, 1, 2].map((int i) { children: <int>[0, 1, 2].map((int i) {
...@@ -52,13 +52,13 @@ class _ToggleControlsDemoState extends State<ToggleControlsDemo> { ...@@ -52,13 +52,13 @@ class _ToggleControlsDemoState extends State<ToggleControlsDemo> {
onChanged: _setRadioValue onChanged: _setRadioValue
); );
}).toList(), }).toList(),
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
), ),
new Row( new Row(
children: <int>[0, 1].map((int i) { children: <int>[0, 1].map((int i) {
return new Radio<int>(value: i, groupValue: 0); // Disabled return new Radio<int>(value: i, groupValue: 0); // Disabled
}).toList(), }).toList(),
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
), ),
new Row( new Row(
children: <Widget>[ children: <Widget>[
...@@ -66,10 +66,10 @@ class _ToggleControlsDemoState extends State<ToggleControlsDemo> { ...@@ -66,10 +66,10 @@ class _ToggleControlsDemoState extends State<ToggleControlsDemo> {
new Switch(value: false), // Disabled new Switch(value: false), // Disabled
new Switch(value: true), // Disabled new Switch(value: true), // Disabled
], ],
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
), ),
], ],
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
) )
); );
} }
......
...@@ -19,7 +19,7 @@ class TooltipDemo extends StatelessWidget { ...@@ -19,7 +19,7 @@ class TooltipDemo extends StatelessWidget {
body: new Builder( body: new Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[ children: <Widget>[
new Text(_introText, style: theme.textTheme.subhead), new Text(_introText, style: theme.textTheme.subhead),
new Row( new Row(
......
...@@ -22,7 +22,7 @@ class TextStyleItem extends StatelessWidget { ...@@ -22,7 +22,7 @@ class TextStyleItem extends StatelessWidget {
return new Padding( return new Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0), padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 16.0),
child: new Row( child: new Row(
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
new SizedBox( new SizedBox(
width: 64.0, width: 64.0,
......
...@@ -83,7 +83,7 @@ class _WeatherDemoState extends State<WeatherDemo> { ...@@ -83,7 +83,7 @@ class _WeatherDemoState extends State<WeatherDemo> {
new Align( new Align(
alignment: new FractionalOffset(0.5, 0.8), alignment: new FractionalOffset(0.5, 0.8),
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new WeatherButton( new WeatherButton(
onPressed: () { onPressed: () {
......
...@@ -102,7 +102,7 @@ class StockRow extends StatelessWidget { ...@@ -102,7 +102,7 @@ class StockRow extends StatelessWidget {
) )
), ),
], ],
alignItems: FlexAlignItems.baseline, crossAxisAlignment: CrossAxisAlignment.baseline,
textBaseline: DefaultTextStyle.of(context).textBaseline textBaseline: DefaultTextStyle.of(context).textBaseline
) )
), ),
......
...@@ -37,7 +37,7 @@ class StockSymbolView extends StatelessWidget { ...@@ -37,7 +37,7 @@ class StockSymbolView extends StatelessWidget {
child: new StockArrow(percentChange: stock.percentChange) child: new StockArrow(percentChange: stock.percentChange)
), ),
], ],
justifyContent: FlexJustifyContent.spaceBetween mainAxisAlignment: MainAxisAlignment.spaceBetween
), ),
new Text('Last Sale', style: headings), new Text('Last Sale', style: headings),
new Text('$lastSale ($changeInPrice)'), new Text('$lastSale ($changeInPrice)'),
...@@ -60,7 +60,7 @@ class StockSymbolView extends StatelessWidget { ...@@ -60,7 +60,7 @@ class StockSymbolView extends StatelessWidget {
) )
), ),
], ],
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
); );
} }
......
...@@ -142,7 +142,7 @@ class AppBar extends StatelessWidget { ...@@ -142,7 +142,7 @@ class AppBar extends StatelessWidget {
Widget appBar = toolBar; Widget appBar = toolBar;
if (tabBar != null) { if (tabBar != null) {
appBar = new Column( appBar = new Column(
justifyContent: FlexJustifyContent.collapse, mainAxisAlignment: MainAxisAlignment.collapse,
children: <Widget>[toolBar, tabBar] children: <Widget>[toolBar, tabBar]
); );
} else if (flexibleSpace != null) { } else if (flexibleSpace != null) {
......
...@@ -87,7 +87,7 @@ class Chip extends StatelessWidget { ...@@ -87,7 +87,7 @@ class Chip extends StatelessWidget {
), ),
child: new Row( child: new Row(
children: children, children: children,
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
) )
); );
......
...@@ -98,7 +98,7 @@ class _DatePickerState extends State<DatePicker> { ...@@ -98,7 +98,7 @@ class _DatePickerState extends State<DatePicker> {
child: picker child: picker
) )
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
); );
} }
...@@ -197,7 +197,7 @@ class DayPicker extends StatelessWidget { ...@@ -197,7 +197,7 @@ class DayPicker extends StatelessWidget {
new Text(new DateFormat("MMMM y").format(displayedMonth), style: monthStyle), new Text(new DateFormat("MMMM y").format(displayedMonth), style: monthStyle),
new Flex( new Flex(
children: headers, children: headers,
justifyContent: FlexJustifyContent.spaceAround mainAxisAlignment: MainAxisAlignment.spaceAround
) )
]; ];
int year = displayedMonth.year; int year = displayedMonth.year;
......
...@@ -90,7 +90,7 @@ class Dialog extends StatelessWidget { ...@@ -90,7 +90,7 @@ class Dialog extends StatelessWidget {
child: new Container( child: new Container(
child: new Row( child: new Row(
children: actions, children: actions,
justifyContent: FlexJustifyContent.end mainAxisAlignment: MainAxisAlignment.end
) )
) )
)); ));
......
...@@ -304,7 +304,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> { ...@@ -304,7 +304,7 @@ class _DropDownButtonState<T> extends State<DropDownButton<T>> {
padding: const EdgeInsets.only(top: 6.0) padding: const EdgeInsets.only(top: 6.0)
) )
], ],
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
) )
); );
......
...@@ -53,7 +53,7 @@ class GridTileBar extends StatelessWidget { ...@@ -53,7 +53,7 @@ class GridTileBar extends StatelessWidget {
children.add( children.add(
new Flexible( new Flexible(
child: new Column( child: new Column(
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
new DefaultTextStyle( new DefaultTextStyle(
style: Typography.white.subhead, style: Typography.white.subhead,
...@@ -87,7 +87,7 @@ class GridTileBar extends StatelessWidget { ...@@ -87,7 +87,7 @@ class GridTileBar extends StatelessWidget {
child: new IconTheme( child: new IconTheme(
data: new IconThemeData(color: Colors.white), data: new IconThemeData(color: Colors.white),
child: new Row( child: new Row(
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: children children: children
) )
) )
......
...@@ -188,7 +188,7 @@ class _InputState extends State<Input> { ...@@ -188,7 +188,7 @@ class _InputState extends State<Input> {
double iconSize = config.isDense ? 18.0 : 24.0; double iconSize = config.isDense ? 18.0 : 24.0;
double iconTop = topPadding + (textStyle.fontSize - iconSize) / 2.0; double iconTop = topPadding + (textStyle.fontSize - iconSize) / 2.0;
child = new Row( child = new Row(
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
new Container( new Container(
margin: new EdgeInsets.only(right: 16.0, top: iconTop), margin: new EdgeInsets.only(right: 16.0, top: iconTop),
......
...@@ -121,8 +121,8 @@ class ListItem extends StatelessWidget { ...@@ -121,8 +121,8 @@ class ListItem extends StatelessWidget {
Widget center = primaryLine; Widget center = primaryLine;
if (isTwoLine || isThreeLine) { if (isTwoLine || isThreeLine) {
center = new Column( center = new Column(
justifyContent: FlexJustifyContent.collapse, mainAxisAlignment: MainAxisAlignment.collapse,
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
primaryLine, primaryLine,
new DefaultTextStyle( new DefaultTextStyle(
...@@ -153,7 +153,7 @@ class ListItem extends StatelessWidget { ...@@ -153,7 +153,7 @@ class ListItem extends StatelessWidget {
height: itemHeight, height: itemHeight,
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new Row( child: new Row(
alignItems: FlexAlignItems.center, crossAxisAlignment: CrossAxisAlignment.center,
children: children children: children
) )
) )
......
...@@ -132,7 +132,7 @@ class SnackBar extends StatelessWidget { ...@@ -132,7 +132,7 @@ class SnackBar extends StatelessWidget {
opacity: fadeAnimation, opacity: fadeAnimation,
child: new Row( child: new Row(
children: children, children: children,
alignItems: FlexAlignItems.center crossAxisAlignment: CrossAxisAlignment.center
) )
) )
) )
......
...@@ -346,8 +346,8 @@ class _Tab extends StatelessWidget { ...@@ -346,8 +346,8 @@ class _Tab extends StatelessWidget {
), ),
_buildLabelText() _buildLabelText()
], ],
justifyContent: FlexJustifyContent.center, mainAxisAlignment: MainAxisAlignment.center,
alignItems: FlexAlignItems.center crossAxisAlignment: CrossAxisAlignment.center
); );
} }
...@@ -1010,7 +1010,7 @@ class TabPageSelector<T> extends StatelessWidget { ...@@ -1010,7 +1010,7 @@ class TabPageSelector<T> extends StatelessWidget {
label: 'Page ${selection.index + 1} of ${selection.values.length}', label: 'Page ${selection.index + 1} of ${selection.values.length}',
child: new Row( child: new Row(
children: selection.values.map((T tab) => _buildTabIndicator(selection, tab, animation, selectedColor, previousColor)).toList(), 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> { ...@@ -135,7 +135,7 @@ class _TimePickerState extends State<TimePicker> {
) )
) )
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
); );
} }
} }
...@@ -223,12 +223,12 @@ class _TimePickerHeader extends StatelessWidget { ...@@ -223,12 +223,12 @@ class _TimePickerHeader extends StatelessWidget {
child: new Text('PM', style: pmStyle) child: new Text('PM', style: pmStyle)
), ),
], ],
justifyContent: FlexJustifyContent.end mainAxisAlignment: MainAxisAlignment.end
) )
) )
) )
], ],
justifyContent: FlexJustifyContent.end mainAxisAlignment: MainAxisAlignment.end
) )
); );
} }
......
...@@ -29,7 +29,7 @@ enum FlexDirection { ...@@ -29,7 +29,7 @@ enum FlexDirection {
} }
/// How the children should be placed along the main axis in a flex layout /// 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 /// Place the children as close to the start of the main axis as possible
start, start,
/// Place the children as close to the end of the main axis as possible /// Place the children as close to the end of the main axis as possible
...@@ -45,7 +45,7 @@ enum FlexJustifyContent { ...@@ -45,7 +45,7 @@ enum FlexJustifyContent {
} }
/// How the children should be placed along the cross axis in a flex layout /// 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 /// Place the children as close to the start of the cross axis as possible
start, start,
/// Place the children as close to the end of the cross axis as possible /// 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) ...@@ -70,23 +70,23 @@ typedef double _ChildSizingFunction(RenderBox child, BoxConstraints constraints)
/// children. Otherwise, the flex expands to the maximum max-axis size and the /// children. Otherwise, the flex expands to the maximum max-axis size and the
/// remaining space along is divided among the flexible children according to /// 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 /// 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 /// 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 /// 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>, class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, FlexParentData>,
RenderBoxContainerDefaultsMixin<RenderBox, FlexParentData> { RenderBoxContainerDefaultsMixin<RenderBox, FlexParentData> {
RenderFlex({ RenderFlex({
List<RenderBox> children, List<RenderBox> children,
FlexDirection direction: FlexDirection.horizontal, FlexDirection direction: FlexDirection.horizontal,
FlexJustifyContent justifyContent: FlexJustifyContent.start, MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start,
FlexAlignItems alignItems: FlexAlignItems.center, CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center,
TextBaseline textBaseline TextBaseline textBaseline
}) : _direction = direction, }) : _direction = direction,
_justifyContent = justifyContent, _mainAxisAlignment = mainAxisAlignment,
_alignItems = alignItems, _crossAxisAlignment = crossAxisAlignment,
_textBaseline = textBaseline { _textBaseline = textBaseline {
addAll(children); addAll(children);
} }
...@@ -102,21 +102,21 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -102,21 +102,21 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
} }
/// How the children should be placed along the main axis /// How the children should be placed along the main axis
FlexJustifyContent get justifyContent => _justifyContent; MainAxisAlignment get mainAxisAlignment => _mainAxisAlignment;
FlexJustifyContent _justifyContent; MainAxisAlignment _mainAxisAlignment;
void set justifyContent (FlexJustifyContent value) { void set mainAxisAlignment (MainAxisAlignment value) {
if (_justifyContent != value) { if (_mainAxisAlignment != value) {
_justifyContent = value; _mainAxisAlignment = value;
markNeedsLayout(); markNeedsLayout();
} }
} }
/// How the children should be placed along the cross axis /// How the children should be placed along the cross axis
FlexAlignItems get alignItems => _alignItems; CrossAxisAlignment get crossAxisAlignment => _crossAxisAlignment;
FlexAlignItems _alignItems; CrossAxisAlignment _crossAxisAlignment;
void set alignItems (FlexAlignItems value) { void set crossAxisAlignment (CrossAxisAlignment value) {
if (_alignItems != value) { if (_crossAxisAlignment != value) {
_alignItems = value; _crossAxisAlignment = value;
markNeedsLayout(); markNeedsLayout();
} }
} }
...@@ -336,7 +336,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -336,7 +336,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
int totalChildren = 0; int totalChildren = 0;
assert(constraints != null); assert(constraints != null);
final double mainSize = (_direction == FlexDirection.horizontal) ? constraints.constrainWidth() : constraints.constrainHeight(); 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 crossSize = 0.0; // This is determined as we lay out the children
double freeSpace = canFlex ? mainSize : 0.0; double freeSpace = canFlex ? mainSize : 0.0;
RenderBox child = firstChild; RenderBox child = firstChild;
...@@ -352,7 +352,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -352,7 +352,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
totalFlex += childParentData.flex; totalFlex += childParentData.flex;
} else { } else {
BoxConstraints innerConstraints; BoxConstraints innerConstraints;
if (alignItems == FlexAlignItems.stretch) { if (crossAxisAlignment == CrossAxisAlignment.stretch) {
switch (_direction) { switch (_direction) {
case FlexDirection.horizontal: case FlexDirection.horizontal:
innerConstraints = new BoxConstraints(minHeight: constraints.maxHeight, innerConstraints = new BoxConstraints(minHeight: constraints.maxHeight,
...@@ -386,7 +386,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -386,7 +386,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
// Distribute remaining space to flexible children, and determine baseline. // Distribute remaining space to flexible children, and determine baseline.
double maxBaselineDistance = 0.0; double maxBaselineDistance = 0.0;
double usedSpace = 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; double spacePerFlex = totalFlex > 0 ? (freeSpace / totalFlex) : 0.0;
child = firstChild; child = firstChild;
while (child != null) { while (child != null) {
...@@ -394,7 +394,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -394,7 +394,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
if (flex > 0) { if (flex > 0) {
double spaceForChild = spacePerFlex * flex; double spaceForChild = spacePerFlex * flex;
BoxConstraints innerConstraints; BoxConstraints innerConstraints;
if (alignItems == FlexAlignItems.stretch) { if (crossAxisAlignment == CrossAxisAlignment.stretch) {
switch (_direction) { switch (_direction) {
case FlexDirection.horizontal: case FlexDirection.horizontal:
innerConstraints = new BoxConstraints(minWidth: spaceForChild, innerConstraints = new BoxConstraints(minWidth: spaceForChild,
...@@ -427,7 +427,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -427,7 +427,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
usedSpace += _getMainSize(child); usedSpace += _getMainSize(child);
crossSize = math.max(crossSize, _getCrossSize(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); 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); double distance = child.getDistanceToBaseline(textBaseline, onlyReal: true);
if (distance != null) if (distance != null)
...@@ -473,25 +473,25 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -473,25 +473,25 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
} }
_overflow = 0.0; _overflow = 0.0;
} }
switch (_justifyContent) { switch (_mainAxisAlignment) {
case FlexJustifyContent.start: case MainAxisAlignment.start:
case FlexJustifyContent.collapse: case MainAxisAlignment.collapse:
leadingSpace = 0.0; leadingSpace = 0.0;
betweenSpace = 0.0; betweenSpace = 0.0;
break; break;
case FlexJustifyContent.end: case MainAxisAlignment.end:
leadingSpace = remainingSpace; leadingSpace = remainingSpace;
betweenSpace = 0.0; betweenSpace = 0.0;
break; break;
case FlexJustifyContent.center: case MainAxisAlignment.center:
leadingSpace = remainingSpace / 2.0; leadingSpace = remainingSpace / 2.0;
betweenSpace = 0.0; betweenSpace = 0.0;
break; break;
case FlexJustifyContent.spaceBetween: case MainAxisAlignment.spaceBetween:
leadingSpace = 0.0; leadingSpace = 0.0;
betweenSpace = totalChildren > 1 ? remainingSpace / (totalChildren - 1) : 0.0; betweenSpace = totalChildren > 1 ? remainingSpace / (totalChildren - 1) : 0.0;
break; break;
case FlexJustifyContent.spaceAround: case MainAxisAlignment.spaceAround:
betweenSpace = totalChildren > 0 ? remainingSpace / totalChildren : 0.0; betweenSpace = totalChildren > 0 ? remainingSpace / totalChildren : 0.0;
leadingSpace = betweenSpace / 2.0; leadingSpace = betweenSpace / 2.0;
break; break;
...@@ -503,18 +503,18 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -503,18 +503,18 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
while (child != null) { while (child != null) {
final FlexParentData childParentData = child.parentData; final FlexParentData childParentData = child.parentData;
double childCrossPosition; double childCrossPosition;
switch (_alignItems) { switch (_crossAxisAlignment) {
case FlexAlignItems.stretch: case CrossAxisAlignment.stretch:
case FlexAlignItems.start: case CrossAxisAlignment.start:
childCrossPosition = 0.0; childCrossPosition = 0.0;
break; break;
case FlexAlignItems.end: case CrossAxisAlignment.end:
childCrossPosition = crossSize - _getCrossSize(child); childCrossPosition = crossSize - _getCrossSize(child);
break; break;
case FlexAlignItems.center: case CrossAxisAlignment.center:
childCrossPosition = crossSize / 2.0 - _getCrossSize(child) / 2.0; childCrossPosition = crossSize / 2.0 - _getCrossSize(child) / 2.0;
break; break;
case FlexAlignItems.baseline: case CrossAxisAlignment.baseline:
childCrossPosition = 0.0; childCrossPosition = 0.0;
if (_direction == FlexDirection.horizontal) { if (_direction == FlexDirection.horizontal) {
assert(textBaseline != null); assert(textBaseline != null);
...@@ -595,8 +595,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl ...@@ -595,8 +595,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
void debugFillDescription(List<String> description) { void debugFillDescription(List<String> description) {
super.debugFillDescription(description); super.debugFillDescription(description);
description.add('direction: $_direction'); description.add('direction: $_direction');
description.add('justifyContent: $_justifyContent'); description.add('mainAxisAlignment: $_mainAxisAlignment');
description.add('alignItems: $_alignItems'); description.add('crossAxisAlignment: $_crossAxisAlignment');
description.add('textBaseline: $_textBaseline'); description.add('textBaseline: $_textBaseline');
} }
......
...@@ -17,9 +17,9 @@ export 'package:flutter/rendering.dart' show ...@@ -17,9 +17,9 @@ export 'package:flutter/rendering.dart' show
CustomClipper, CustomClipper,
CustomPainter, CustomPainter,
FixedColumnCountGridDelegate, FixedColumnCountGridDelegate,
FlexAlignItems, CrossAxisAlignment,
FlexDirection, FlexDirection,
FlexJustifyContent, MainAxisAlignment,
FractionalOffsetTween, FractionalOffsetTween,
GridDelegate, GridDelegate,
GridDelegateWithInOrderChildPlacement, GridDelegateWithInOrderChildPlacement,
...@@ -1355,27 +1355,27 @@ class Flex extends MultiChildRenderObjectWidget { ...@@ -1355,27 +1355,27 @@ class Flex extends MultiChildRenderObjectWidget {
Key key, Key key,
List<Widget> children: _emptyWidgetList, List<Widget> children: _emptyWidgetList,
this.direction: FlexDirection.horizontal, this.direction: FlexDirection.horizontal,
this.justifyContent: FlexJustifyContent.start, this.mainAxisAlignment: MainAxisAlignment.start,
this.alignItems: FlexAlignItems.center, this.crossAxisAlignment: CrossAxisAlignment.center,
this.textBaseline this.textBaseline
}) : super(key: key, children: children) { }) : super(key: key, children: children) {
assert(direction != null); assert(direction != null);
assert(justifyContent != null); assert(mainAxisAlignment != null);
assert(alignItems != null); assert(crossAxisAlignment != null);
} }
final FlexDirection direction; final FlexDirection direction;
final FlexJustifyContent justifyContent; final MainAxisAlignment mainAxisAlignment;
final FlexAlignItems alignItems; final CrossAxisAlignment crossAxisAlignment;
final TextBaseline textBaseline; 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) { void updateRenderObject(BuildContext context, RenderFlex renderObject) {
renderObject renderObject
..direction = direction ..direction = direction
..justifyContent = justifyContent ..mainAxisAlignment = mainAxisAlignment
..alignItems = alignItems ..crossAxisAlignment = crossAxisAlignment
..textBaseline = textBaseline; ..textBaseline = textBaseline;
} }
} }
...@@ -1388,15 +1388,15 @@ class Row extends Flex { ...@@ -1388,15 +1388,15 @@ class Row extends Flex {
Row({ Row({
Key key, Key key,
List<Widget> children: _emptyWidgetList, List<Widget> children: _emptyWidgetList,
FlexJustifyContent justifyContent: FlexJustifyContent.start, MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start,
FlexAlignItems alignItems: FlexAlignItems.center, CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center,
TextBaseline textBaseline TextBaseline textBaseline
}) : super( }) : super(
children: children, children: children,
key: key, key: key,
direction: FlexDirection.horizontal, direction: FlexDirection.horizontal,
justifyContent: justifyContent, mainAxisAlignment: mainAxisAlignment,
alignItems: alignItems, crossAxisAlignment: crossAxisAlignment,
textBaseline: textBaseline textBaseline: textBaseline
); );
} }
...@@ -1409,15 +1409,15 @@ class Column extends Flex { ...@@ -1409,15 +1409,15 @@ class Column extends Flex {
Column({ Column({
Key key, Key key,
List<Widget> children: _emptyWidgetList, List<Widget> children: _emptyWidgetList,
FlexJustifyContent justifyContent: FlexJustifyContent.start, MainAxisAlignment mainAxisAlignment: MainAxisAlignment.start,
FlexAlignItems alignItems: FlexAlignItems.center, CrossAxisAlignment crossAxisAlignment: CrossAxisAlignment.center,
TextBaseline textBaseline TextBaseline textBaseline
}) : super( }) : super(
children: children, children: children,
key: key, key: key,
direction: FlexDirection.vertical, direction: FlexDirection.vertical,
justifyContent: justifyContent, mainAxisAlignment: mainAxisAlignment,
alignItems: alignItems, crossAxisAlignment: crossAxisAlignment,
textBaseline: textBaseline textBaseline: textBaseline
); );
} }
......
...@@ -40,7 +40,7 @@ void main() { ...@@ -40,7 +40,7 @@ void main() {
RenderBox flex = new RenderFlex( RenderBox flex = new RenderFlex(
children: <RenderBox>[padding], children: <RenderBox>[padding],
direction: FlexDirection.vertical, direction: FlexDirection.vertical,
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
); );
RenderBox outer = new RenderDecoratedBox( RenderBox outer = new RenderDecoratedBox(
decoration: new BoxDecoration( decoration: new BoxDecoration(
......
...@@ -80,7 +80,7 @@ void main() { ...@@ -80,7 +80,7 @@ void main() {
test('Defaults', () { test('Defaults', () {
RenderFlex flex = new RenderFlex(); RenderFlex flex = new RenderFlex();
expect(flex.alignItems, equals(FlexAlignItems.center)); expect(flex.crossAxisAlignment, equals(CrossAxisAlignment.center));
expect(flex.direction, equals(FlexDirection.horizontal)); expect(flex.direction, equals(FlexDirection.horizontal));
}); });
...@@ -122,7 +122,7 @@ void main() { ...@@ -122,7 +122,7 @@ void main() {
expect(box2.size.width, equals(100.0)); expect(box2.size.width, equals(100.0));
expect(box2.size.height, equals(0.0)); expect(box2.size.height, equals(0.0));
flex.alignItems = FlexAlignItems.stretch; flex.crossAxisAlignment = CrossAxisAlignment.stretch;
pumpFrame(); pumpFrame();
expect(box1.size.width, equals(0.0)); expect(box1.size.width, equals(0.0));
expect(box1.size.height, equals(100.0)); expect(box1.size.height, equals(100.0));
......
...@@ -54,7 +54,7 @@ void main() { ...@@ -54,7 +54,7 @@ void main() {
test('Row, Column and FlexJustifyContent.collapse', () { test('Row, Column and FlexJustifyContent.collapse', () {
final Key flexKey = new Key('flexKey'); final Key flexKey = new Key('flexKey');
// Row without justifyContent: FlexJustifyContent.collapse // Row without mainAxisAlignment: FlexJustifyContent.collapse
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
tester.pumpWidget(new Center( tester.pumpWidget(new Center(
child: new Row( child: new Row(
...@@ -69,7 +69,7 @@ void main() { ...@@ -69,7 +69,7 @@ void main() {
expect(renderBox.size.width, equals(800.0)); expect(renderBox.size.width, equals(800.0));
expect(renderBox.size.height, equals(100.0)); expect(renderBox.size.height, equals(100.0));
// Row with justifyContent: FlexJustifyContent.collapse // Row with mainAxisAlignment: FlexJustifyContent.collapse
tester.pumpWidget(new Center( tester.pumpWidget(new Center(
child: new Row( child: new Row(
children: <Widget>[ children: <Widget>[
...@@ -77,7 +77,7 @@ void main() { ...@@ -77,7 +77,7 @@ void main() {
new Container(width: 30.0, height: 100.0) new Container(width: 30.0, height: 100.0)
], ],
key: flexKey, key: flexKey,
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
)); ));
renderBox = tester.findElementByKey(flexKey).renderObject; renderBox = tester.findElementByKey(flexKey).renderObject;
...@@ -85,7 +85,7 @@ void main() { ...@@ -85,7 +85,7 @@ void main() {
expect(renderBox.size.height, equals(100.0)); expect(renderBox.size.height, equals(100.0));
}); });
// Column without justifyContent: FlexJustifyContent.collapse // Column without mainAxisAlignment: FlexJustifyContent.collapse
testWidgets((WidgetTester tester) { testWidgets((WidgetTester tester) {
tester.pumpWidget(new Center( tester.pumpWidget(new Center(
child: new Column( child: new Column(
...@@ -100,7 +100,7 @@ void main() { ...@@ -100,7 +100,7 @@ void main() {
expect(renderBox.size.width, equals(100.0)); expect(renderBox.size.width, equals(100.0));
expect(renderBox.size.height, equals(600.0)); expect(renderBox.size.height, equals(600.0));
// Column with justifyContent: FlexJustifyContent.collapse // Column with mainAxisAlignment: FlexJustifyContent.collapse
tester.pumpWidget(new Center( tester.pumpWidget(new Center(
child: new Column( child: new Column(
children: <Widget>[ children: <Widget>[
...@@ -108,7 +108,7 @@ void main() { ...@@ -108,7 +108,7 @@ void main() {
new Container(width: 100.0, height: 150.0) new Container(width: 100.0, height: 150.0)
], ],
key: flexKey, key: flexKey,
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
)); ));
renderBox = tester.findElementByKey(flexKey).renderObject; renderBox = tester.findElementByKey(flexKey).renderObject;
...@@ -133,7 +133,7 @@ void main() { ...@@ -133,7 +133,7 @@ void main() {
height: 100.0 height: 100.0
) )
], ],
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
) )
)); ));
...@@ -154,7 +154,7 @@ void main() { ...@@ -154,7 +154,7 @@ void main() {
height: 100.0 height: 100.0
) )
], ],
justifyContent: FlexJustifyContent.collapse mainAxisAlignment: MainAxisAlignment.collapse
) )
) )
)); ));
......
...@@ -18,7 +18,7 @@ void main() { ...@@ -18,7 +18,7 @@ void main() {
key: rotatedBoxKey, key: rotatedBoxKey,
quarterTurns: 1, quarterTurns: 1,
child: new Row( child: new Row(
justifyContent: FlexJustifyContent.collapse, mainAxisAlignment: MainAxisAlignment.collapse,
children: <Widget>[ children: <Widget>[
new GestureDetector( new GestureDetector(
onTap: () { log.add('left'); }, onTap: () { log.add('left'); },
......
...@@ -58,7 +58,7 @@ void main() { ...@@ -58,7 +58,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
...@@ -95,7 +95,7 @@ void main() { ...@@ -95,7 +95,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
...@@ -160,7 +160,7 @@ void main() { ...@@ -160,7 +160,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
...@@ -197,7 +197,7 @@ void main() { ...@@ -197,7 +197,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
......
...@@ -35,7 +35,7 @@ void main() { ...@@ -35,7 +35,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
...@@ -100,7 +100,7 @@ void main() { ...@@ -100,7 +100,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
...@@ -137,7 +137,7 @@ void main() { ...@@ -137,7 +137,7 @@ void main() {
) )
), ),
], ],
alignItems: FlexAlignItems.stretch crossAxisAlignment: CrossAxisAlignment.stretch
) )
); );
expect(client.updates.length, equals(2)); expect(client.updates.length, equals(2));
......
...@@ -172,7 +172,7 @@ class _MarkdownBodyRawState extends State<MarkdownBodyRaw> { ...@@ -172,7 +172,7 @@ class _MarkdownBodyRawState extends State<MarkdownBodyRaw> {
} }
return new Column( return new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: blocks children: blocks
); );
} }
...@@ -365,7 +365,7 @@ class _Block { ...@@ -365,7 +365,7 @@ class _Block {
} }
contents = new Column( contents = new Column(
alignItems: FlexAlignItems.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: subWidgets children: subWidgets
); );
} else { } else {
...@@ -391,7 +391,7 @@ class _Block { ...@@ -391,7 +391,7 @@ class _Block {
} }
contents = new Row( contents = new Row(
alignItems: FlexAlignItems.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
new SizedBox( new SizedBox(
width: listIndents.length * markdownStyle.listIndent, width: listIndents.length * markdownStyle.listIndent,
......
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