Commit fd09a8a9 authored by ouxiang's avatar ouxiang

optimize channel test

parent a664f8e1
...@@ -52,24 +52,31 @@ class _PlatformChannelState extends State<PlatformChannel> { ...@@ -52,24 +52,31 @@ class _PlatformChannelState extends State<PlatformChannel> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
child: Column( child: Scaffold(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, appBar: AppBar(
children: <Widget>[ title: Text('Channel test'),
Column( ),
mainAxisAlignment: MainAxisAlignment.center, body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Text(_batteryLevel, key: const Key('Battery level label')), Column(
Padding( mainAxisAlignment: MainAxisAlignment.center,
padding: const EdgeInsets.all(16.0), children: <Widget>[
child: RaisedButton( Text(_batteryLevel, key: const Key('Battery level label')),
child: const Text('Refresh'), Padding(
onPressed: _getBatteryLevel, padding: const EdgeInsets.all(16.0),
), child: RaisedButton(
child: const Text('Refresh'),
onPressed: _getBatteryLevel,
),
),
],
), ),
Text(_chargingStatus),
], ],
), ),
Text(_chargingStatus), ),
],
), ),
); );
} }
......
...@@ -107,6 +107,7 @@ class _MyHomePageState extends State<MyHomePage> { ...@@ -107,6 +107,7 @@ class _MyHomePageState extends State<MyHomePage> {
), ),
FlatButton( FlatButton(
child: Text('channel test'), child: Text('channel test'),
color: Colors.green,
onPressed: (){Navigator.pushNamed(context, "/channeltest");}, onPressed: (){Navigator.pushNamed(context, "/channeltest");},
) )
], ],
......
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