Rename Container.align to alignment (#6116)
To match the Align widget (and several other widgets). Fixes #6101
This commit is contained in:
parent
c621ec82a0
commit
6469872abd
@ -284,7 +284,7 @@ class CardCollectionState extends State<CardCollection> {
|
|||||||
flexibleSpace: new Container(
|
flexibleSpace: new Container(
|
||||||
padding: const EdgeInsets.only(left: 72.0),
|
padding: const EdgeInsets.only(left: 72.0),
|
||||||
height: 128.0,
|
height: 128.0,
|
||||||
align: const FractionalOffset(0.0, 0.75),
|
alignment: const FractionalOffset(0.0, 0.75),
|
||||||
child: new Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.title)
|
child: new Text('Swipe Away: ${_cardModels.length}', style: Theme.of(context).primaryTextTheme.title)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -166,7 +166,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
decoration: new BoxDecoration(
|
decoration: new BoxDecoration(
|
||||||
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
|
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
|
||||||
),
|
),
|
||||||
align: FractionalOffset.bottomLeft,
|
alignment: FractionalOffset.bottomLeft,
|
||||||
child: new Text('Event name', style: theme.textTheme.display2)
|
child: new Text('Event name', style: theme.textTheme.display2)
|
||||||
),
|
),
|
||||||
new Container(
|
new Container(
|
||||||
@ -174,7 +174,7 @@ class FullScreenDialogDemoState extends State<FullScreenDialogDemo> {
|
|||||||
decoration: new BoxDecoration(
|
decoration: new BoxDecoration(
|
||||||
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
|
border: new Border(bottom: new BorderSide(color: theme.dividerColor))
|
||||||
),
|
),
|
||||||
align: FractionalOffset.bottomLeft,
|
alignment: FractionalOffset.bottomLeft,
|
||||||
child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54))
|
child: new Text('Location', style: theme.textTheme.title.copyWith(color: Colors.black54))
|
||||||
),
|
),
|
||||||
new Column(
|
new Column(
|
||||||
|
@ -121,7 +121,7 @@ class TextFieldDemoState extends State<TextFieldDemo> {
|
|||||||
),
|
),
|
||||||
new Container(
|
new Container(
|
||||||
padding: const EdgeInsets.all(20.0),
|
padding: const EdgeInsets.all(20.0),
|
||||||
align: const FractionalOffset(0.5, 0.5),
|
alignment: const FractionalOffset(0.5, 0.5),
|
||||||
child: new RaisedButton(
|
child: new RaisedButton(
|
||||||
child: new Text('SUBMIT'),
|
child: new Text('SUBMIT'),
|
||||||
onPressed: _handleSubmitted,
|
onPressed: _handleSubmitted,
|
||||||
|
@ -130,7 +130,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
|
|||||||
new Container(
|
new Container(
|
||||||
height: 48.0,
|
height: 48.0,
|
||||||
padding: const EdgeInsets.only(left: 16.0),
|
padding: const EdgeInsets.only(left: 16.0),
|
||||||
align: FractionalOffset.centerLeft,
|
alignment: FractionalOffset.centerLeft,
|
||||||
child: new Text(galleryItem.category, style: headerStyle)
|
child: new Text(galleryItem.category, style: headerStyle)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@ -406,7 +406,7 @@ class DataTable extends StatelessWidget {
|
|||||||
label = new Container(
|
label = new Container(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
height: _kHeadingRowHeight,
|
height: _kHeadingRowHeight,
|
||||||
align: new FractionalOffset(numeric ? 1.0 : 0.0, 0.5), // TODO(ianh): RTL for non-numeric
|
alignment: new FractionalOffset(numeric ? 1.0 : 0.0, 0.5), // TODO(ianh): RTL for non-numeric
|
||||||
child: new AnimatedDefaultTextStyle(
|
child: new AnimatedDefaultTextStyle(
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
// TODO(ianh): font family should be Roboto; see https://github.com/flutter/flutter/issues/3116
|
// TODO(ianh): font family should be Roboto; see https://github.com/flutter/flutter/issues/3116
|
||||||
@ -456,7 +456,7 @@ class DataTable extends StatelessWidget {
|
|||||||
label = new Container(
|
label = new Container(
|
||||||
padding: padding,
|
padding: padding,
|
||||||
height: _kDataRowHeight,
|
height: _kDataRowHeight,
|
||||||
align: new FractionalOffset(numeric ? 1.0 : 0.0, 0.5), // TODO(ianh): RTL for non-numeric
|
alignment: new FractionalOffset(numeric ? 1.0 : 0.0, 0.5), // TODO(ianh): RTL for non-numeric
|
||||||
child: new DefaultTextStyle(
|
child: new DefaultTextStyle(
|
||||||
style: new TextStyle(
|
style: new TextStyle(
|
||||||
// TODO(ianh): font family should be Roboto; see https://github.com/flutter/flutter/issues/3116
|
// TODO(ianh): font family should be Roboto; see https://github.com/flutter/flutter/issues/3116
|
||||||
|
@ -366,7 +366,7 @@ class DropdownMenuItem<T> extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return new Container(
|
return new Container(
|
||||||
height: _kMenuItemHeight,
|
height: _kMenuItemHeight,
|
||||||
align: FractionalOffset.centerLeft,
|
alignment: FractionalOffset.centerLeft,
|
||||||
child: child
|
child: child
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ class ListItem extends StatelessWidget {
|
|||||||
children.add(new Container(
|
children.add(new Container(
|
||||||
margin: const EdgeInsets.only(right: 16.0),
|
margin: const EdgeInsets.only(right: 16.0),
|
||||||
width: 40.0,
|
width: 40.0,
|
||||||
align: FractionalOffset.centerLeft,
|
alignment: FractionalOffset.centerLeft,
|
||||||
child: leading
|
child: leading
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ class ListItem extends StatelessWidget {
|
|||||||
if (trailing != null) {
|
if (trailing != null) {
|
||||||
children.add(new Container(
|
children.add(new Container(
|
||||||
margin: const EdgeInsets.only(left: 16.0),
|
margin: const EdgeInsets.only(left: 16.0),
|
||||||
align: FractionalOffset.centerRight,
|
alignment: FractionalOffset.centerRight,
|
||||||
child: trailing
|
child: trailing
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -381,7 +381,7 @@ class RefreshIndicatorState extends State<RefreshIndicator> with TickerProviderS
|
|||||||
padding: _isIndicatorAtTop
|
padding: _isIndicatorAtTop
|
||||||
? new EdgeInsets.only(top: config.displacement)
|
? new EdgeInsets.only(top: config.displacement)
|
||||||
: new EdgeInsets.only(bottom: config.displacement),
|
: new EdgeInsets.only(bottom: config.displacement),
|
||||||
align: _isIndicatorAtTop
|
alignment: _isIndicatorAtTop
|
||||||
? FractionalOffset.bottomCenter
|
? FractionalOffset.bottomCenter
|
||||||
: FractionalOffset.topCenter,
|
: FractionalOffset.topCenter,
|
||||||
child: new ScaleTransition(
|
child: new ScaleTransition(
|
||||||
|
@ -76,7 +76,7 @@ class Container extends StatelessWidget {
|
|||||||
/// The `height` and `width` values include the padding.
|
/// The `height` and `width` values include the padding.
|
||||||
Container({
|
Container({
|
||||||
Key key,
|
Key key,
|
||||||
this.align,
|
this.alignment,
|
||||||
this.padding,
|
this.padding,
|
||||||
this.decoration,
|
this.decoration,
|
||||||
this.foregroundDecoration,
|
this.foregroundDecoration,
|
||||||
@ -107,7 +107,7 @@ class Container extends StatelessWidget {
|
|||||||
///
|
///
|
||||||
/// If non-null, the container will expand to fill its parent and position its
|
/// If non-null, the container will expand to fill its parent and position its
|
||||||
/// child within itself according to the given value.
|
/// child within itself according to the given value.
|
||||||
final FractionalOffset align;
|
final FractionalOffset alignment;
|
||||||
|
|
||||||
/// Empty space to inscribe inside the decoration.
|
/// Empty space to inscribe inside the decoration.
|
||||||
final EdgeInsets padding;
|
final EdgeInsets padding;
|
||||||
@ -145,8 +145,8 @@ class Container extends StatelessWidget {
|
|||||||
if (child == null && (constraints == null || !constraints.isTight))
|
if (child == null && (constraints == null || !constraints.isTight))
|
||||||
current = new ConstrainedBox(constraints: const BoxConstraints.expand());
|
current = new ConstrainedBox(constraints: const BoxConstraints.expand());
|
||||||
|
|
||||||
if (align != null)
|
if (alignment != null)
|
||||||
current = new Align(alignment: align, child: current);
|
current = new Align(alignment: alignment, child: current);
|
||||||
|
|
||||||
EdgeInsets effectivePadding = _paddingIncludingDecoration;
|
EdgeInsets effectivePadding = _paddingIncludingDecoration;
|
||||||
if (effectivePadding != null)
|
if (effectivePadding != null)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user