Commit f0b8c866 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Fix gallery demo body centering (#6841)

parent e384c0d9
...@@ -119,7 +119,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> ...@@ -119,7 +119,7 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
}); });
} }
Widget _buildBody() { Widget _buildTransitionsStack() {
final List<FadeTransition> transitions = <FadeTransition>[]; final List<FadeTransition> transitions = <FadeTransition>[];
for (NavigationIconView view in _navigationViews) for (NavigationIconView view in _navigationViews)
...@@ -175,7 +175,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo> ...@@ -175,7 +175,9 @@ class _BottomNavigationDemoState extends State<BottomNavigationDemo>
) )
], ],
), ),
body: _buildBody(), body: new Center(
child: _buildTransitionsStack()
),
bottomNavigationBar: botNavBar, bottomNavigationBar: botNavBar,
); );
} }
......
...@@ -36,7 +36,9 @@ class _DatePickerDemoState extends State<DatePickerDemo> { ...@@ -36,7 +36,9 @@ class _DatePickerDemoState extends State<DatePickerDemo> {
return return
new Scaffold( new Scaffold(
appBar: new AppBar(title: new Text('Date picker')), appBar: new AppBar(title: new Text('Date picker')),
body: new Column( body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text(new DateFormat.yMMMd().format(_selectedDate)), new Text(new DateFormat.yMMMd().format(_selectedDate)),
new SizedBox(height: 20.0), new SizedBox(height: 20.0),
...@@ -45,7 +47,7 @@ class _DatePickerDemoState extends State<DatePickerDemo> { ...@@ -45,7 +47,7 @@ class _DatePickerDemoState extends State<DatePickerDemo> {
child: new Text('SELECT DATE') child: new Text('SELECT DATE')
), ),
], ],
mainAxisAlignment: MainAxisAlignment.center ),
) )
); );
} }
......
...@@ -19,7 +19,8 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -19,7 +19,8 @@ class _SliderDemoState extends State<SliderDemo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
appBar: new AppBar(title: new Text('Sliders')), appBar: new AppBar(title: new Text('Sliders')),
body: new Column( body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[ children: <Widget>[
new Column( new Column(
...@@ -61,10 +62,11 @@ class _SliderDemoState extends State<SliderDemo> { ...@@ -61,10 +62,11 @@ class _SliderDemoState extends State<SliderDemo> {
} }
), ),
new Text('Discrete'), new Text('Discrete'),
] ],
),
],
),
), ),
]
)
); );
} }
} }
...@@ -32,7 +32,8 @@ class _TimePickerDemoState extends State<TimePickerDemo> { ...@@ -32,7 +32,8 @@ class _TimePickerDemoState extends State<TimePickerDemo> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return new Scaffold( return new Scaffold(
appBar: new AppBar(title: new Text('Time picker')), appBar: new AppBar(title: new Text('Time picker')),
body: new Column( body: new Center(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
new Text('$_selectedTime'), new Text('$_selectedTime'),
...@@ -41,8 +42,9 @@ class _TimePickerDemoState extends State<TimePickerDemo> { ...@@ -41,8 +42,9 @@ class _TimePickerDemoState extends State<TimePickerDemo> {
onPressed: _handleSelectTime, onPressed: _handleSelectTime,
child: new Text('SELECT TIME') child: new Text('SELECT TIME')
), ),
] ],
) ),
),
); );
} }
} }
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