From 4d2806e7e529da1aeff204eb22f9a709b508a3ab Mon Sep 17 00:00:00 2001 From: Michael Thomsen Date: Thu, 8 Jun 2017 10:51:56 +0200 Subject: [PATCH] Remove comments unrelated to plugin example app (#10532) * Remove comments unrelated to plugin example app * Review feedback --- .../templates/create/lib/main.dart.tmpl | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/flutter_tools/templates/create/lib/main.dart.tmpl b/packages/flutter_tools/templates/create/lib/main.dart.tmpl index 0038a09c43..e0eef75955 100644 --- a/packages/flutter_tools/templates/create/lib/main.dart.tmpl +++ b/packages/flutter_tools/templates/create/lib/main.dart.tmpl @@ -16,6 +16,7 @@ void main() { runApp(new MyApp()); } +{{^withPluginHook}} class MyApp extends StatelessWidget { // This widget is the root of your application. @override @@ -57,7 +58,6 @@ class MyHomePage extends StatefulWidget { _MyHomePageState createState() => new _MyHomePageState(); } -{{^withPluginHook}} class _MyHomePageState extends State { int _counter = 0; @@ -129,7 +129,12 @@ class _MyHomePageState extends State { } {{/withPluginHook}} {{#withPluginHook}} -class _MyHomePageState extends State { +class MyApp extends StatefulWidget { + @override + _MyAppState createState() => new _MyAppState(); +} + +class _MyAppState extends State { String _platformVersion = 'Unknown'; @override @@ -161,11 +166,15 @@ class _MyHomePageState extends State { @override Widget build(BuildContext context) { - return new Scaffold( - appBar: new AppBar( - title: new Text('Plugin example app'), + return new MaterialApp( + home: new Scaffold( + appBar: new AppBar( + title: new Text('Plugin example app'), + ), + body: new Center( + child: new Text('Running on: $_platformVersion\n'), + ), ), - body: new Center(child: new Text('Running on: $_platformVersion\n')), ); } }