Fix gallery demo body centering (#6841)
This commit is contained in:
@@ -119,7 +119,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
Widget _buildTransitionsStack() {
|
||||
final List<FadeTransition> transitions = <FadeTransition>[];
|
||||
|
||||
for (NavigationIconView view in _navigationViews)
|
||||
@@ -175,7 +175,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
|
||||
)
|
||||
],
|
||||
),
|
||||
body: _buildBody(),
|
||||
body: new Center(
|
||||
child: _buildTransitionsStack()
|
||||
),
|
||||
bottomNavigationBar: botNavBar,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,16 +36,18 @@ class _DatePickerDemoState extends State<DatePickerDemo> {
|
||||
return
|
||||
new Scaffold(
|
||||
appBar: new AppBar(title: new Text('Date picker')),
|
||||
body: new Column(
|
||||
children: <Widget>[
|
||||
new Text(new DateFormat.yMMMd().format(_selectedDate)),
|
||||
new SizedBox(height: 20.0),
|
||||
new RaisedButton(
|
||||
onPressed: _handleSelectDate,
|
||||
child: new Text('SELECT DATE')
|
||||
),
|
||||
],
|
||||
mainAxisAlignment: MainAxisAlignment.center
|
||||
body: new Center(
|
||||
child: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text(new DateFormat.yMMMd().format(_selectedDate)),
|
||||
new SizedBox(height: 20.0),
|
||||
new RaisedButton(
|
||||
onPressed: _handleSelectDate,
|
||||
child: new Text('SELECT DATE')
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,52 +19,54 @@ class _SliderDemoState extends State<SliderDemo> {
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(title: new Text('Sliders')),
|
||||
body: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget> [
|
||||
new Slider(
|
||||
value: _value,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
_value = value;
|
||||
});
|
||||
}
|
||||
),
|
||||
new Text('Continuous'),
|
||||
]
|
||||
),
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget> [
|
||||
new Slider(value: 0.25, onChanged: null),
|
||||
new Text('Disabled'),
|
||||
]
|
||||
),
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget> [
|
||||
new Slider(
|
||||
value: _discreteValue,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
divisions: 5,
|
||||
label: '${_discreteValue.round()}',
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
_discreteValue = value;
|
||||
});
|
||||
}
|
||||
),
|
||||
new Text('Discrete'),
|
||||
]
|
||||
),
|
||||
]
|
||||
)
|
||||
body: new Center(
|
||||
child: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget> [
|
||||
new Slider(
|
||||
value: _value,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
_value = value;
|
||||
});
|
||||
}
|
||||
),
|
||||
new Text('Continuous'),
|
||||
]
|
||||
),
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget> [
|
||||
new Slider(value: 0.25, onChanged: null),
|
||||
new Text('Disabled'),
|
||||
]
|
||||
),
|
||||
new Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget> [
|
||||
new Slider(
|
||||
value: _discreteValue,
|
||||
min: 0.0,
|
||||
max: 100.0,
|
||||
divisions: 5,
|
||||
label: '${_discreteValue.round()}',
|
||||
onChanged: (double value) {
|
||||
setState(() {
|
||||
_discreteValue = value;
|
||||
});
|
||||
}
|
||||
),
|
||||
new Text('Discrete'),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,17 +32,19 @@ class _TimePickerDemoState extends State<TimePickerDemo> {
|
||||
Widget build(BuildContext context) {
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(title: new Text('Time picker')),
|
||||
body: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text('$_selectedTime'),
|
||||
new SizedBox(height: 20.0),
|
||||
new RaisedButton(
|
||||
onPressed: _handleSelectTime,
|
||||
child: new Text('SELECT TIME')
|
||||
),
|
||||
]
|
||||
)
|
||||
body: new Center(
|
||||
child: new Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
new Text('$_selectedTime'),
|
||||
new SizedBox(height: 20.0),
|
||||
new RaisedButton(
|
||||
onPressed: _handleSelectTime,
|
||||
child: new Text('SELECT TIME')
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user