From 171b1b08c960c34789582c02e36d6880b88c3eb2 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Fri, 20 Oct 2017 10:46:07 -0700 Subject: [PATCH] tweak the flutter create template to use the function shorthand for main() (#12654) --- packages/flutter_tools/templates/create/lib/main.dart.tmpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/templates/create/lib/main.dart.tmpl b/packages/flutter_tools/templates/create/lib/main.dart.tmpl index b83f001ae7..c808003a2e 100644 --- a/packages/flutter_tools/templates/create/lib/main.dart.tmpl +++ b/packages/flutter_tools/templates/create/lib/main.dart.tmpl @@ -7,14 +7,17 @@ import 'package:flutter/services.dart'; import 'package:{{pluginProjectName}}/{{pluginProjectName}}.dart'; {{/withPluginHook}} -void main() { +{{^withDriverTest}} +void main() => runApp(new MyApp()); +{{/withDriverTest}} {{#withDriverTest}} +void main() { // Enable integration testing with the Flutter Driver extension. // See https://flutter.io/testing/ for more info. enableFlutterDriverExtension(); -{{/withDriverTest}} runApp(new MyApp()); } +{{/withDriverTest}} {{^withPluginHook}} class MyApp extends StatelessWidget {