Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
0c6c6198
Commit
0c6c6198
authored
Oct 10, 2018
by
Philip
Committed by
Dan Field
Oct 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove new keyword from default template app (#22454)
* Remove new keyword from default template app
parent
52e5a9a7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
main.dart.tmpl
packages/flutter_tools/templates/app/lib/main.dart.tmpl
+21
-21
No files found.
packages/flutter_tools/templates/app/lib/main.dart.tmpl
View file @
0c6c6198
...
...
@@ -10,14 +10,14 @@ import 'package:{{pluginProjectName}}/{{pluginProjectName}}.dart';
{{/withPluginHook}}
{{^withDriverTest}}
void main() => runApp(
new
MyApp());
void main() => runApp(MyApp());
{{/withDriverTest}}
{{#withDriverTest}}
void main() {
// Enable integration testing with the Flutter Driver extension.
// See https://flutter.io/testing/ for more info.
enableFlutterDriverExtension();
runApp(
new
MyApp());
runApp(MyApp());
}
{{/withDriverTest}}
...
...
@@ -26,9 +26,9 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return
new
MaterialApp(
return MaterialApp(
title: 'Flutter Demo',
theme:
new
ThemeData(
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
...
...
@@ -39,7 +39,7 @@ class MyApp extends StatelessWidget {
// counter didn't reset back to zero; the application is not restarted.
primarySwatch: Colors.blue,
),
home:
new
MyHomePage(title: 'Flutter Demo Home Page'),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
...
...
@@ -59,7 +59,7 @@ class MyHomePage extends StatefulWidget {
final String title;
@override
_MyHomePageState createState() =>
new
_MyHomePageState();
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
...
...
@@ -84,16 +84,16 @@ class _MyHomePageState extends State<MyHomePage> {
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return
new
Scaffold(
appBar:
new
AppBar(
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title:
new
Text(widget.title),
title: Text(widget.title),
),
body:
new
Center(
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child:
new
Column(
child: Column(
// Column is also layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
...
...
@@ -109,20 +109,20 @@ class _MyHomePageState extends State<MyHomePage> {
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
new
Text(
Text(
'You have pushed the button this many times:',
),
new
Text(
Text(
'$_counter',
style: Theme.of(context).textTheme.display1,
),
],
),
),
floatingActionButton:
new
FloatingActionButton(
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child:
new
Icon(Icons.add),
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
...
...
@@ -131,7 +131,7 @@ class _MyHomePageState extends State<MyHomePage> {
{{#withPluginHook}}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() =>
new
_MyAppState();
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
...
...
@@ -165,13 +165,13 @@ class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return
new
MaterialApp(
home:
new
Scaffold(
appBar:
new
AppBar(
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body:
new
Center(
child:
new
Text('Running on: $_platformVersion\n'),
body: Center(
child: Text('Running on: $_platformVersion\n'),
),
),
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment