Commit 09506d56 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Progress indicator demo should look good in landscape (#6088)

This patch fixes the issue in two ways:

1. The content area is now scrollable, which means you can scroll to reveal any
   parts that don't fit on screen.
2. The content area is now small enough to fit on screen in landscape on a
   Nexus 5.

Fixes #6054
parent c7369a40
......@@ -70,19 +70,29 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
new LinearProgressIndicator(),
new LinearProgressIndicator(),
new LinearProgressIndicator(value: _animation.value),
new Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new CircularProgressIndicator(),
new SizedBox(
width: 20.0,
height: 20.0,
child: new CircularProgressIndicator(value: _animation.value)
),
new Text('${(_animation.value * 100.0).toStringAsFixed(1)}%${ _controller.isAnimating ? "" : " (paused)" }')
new SizedBox(
width: 100.0,
height: 20.0,
child: new Text('${(_animation.value * 100.0).toStringAsFixed(1)}%',
textAlign: TextAlign.right
),
),
],
),
];
return new Column(
children: indicators
.map((Widget c) => new Container(child: c, margin: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 20.0)))
.toList(),
mainAxisAlignment: MainAxisAlignment.center
);
}
......@@ -90,7 +100,9 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(title: new Text('Progress indicators')),
body: new DefaultTextStyle(
body: new Center(
child: new ScrollableViewport(
child: new DefaultTextStyle(
style: Theme.of(context).textTheme.title,
child: new GestureDetector(
onTap: _handleTap,
......@@ -104,6 +116,8 @@ class _ProgressIndicatorDemoState extends State<ProgressIndicatorDemo> with Sing
)
)
)
)
)
);
}
}
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