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
e8e65446
Commit
e8e65446
authored
Jan 12, 2016
by
Seth Ladd
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1207 from sethladd/new-starter-app
starter app now has a button that does something
parents
d04e2221
42d90c00
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
init.dart
packages/flutter_tools/lib/src/commands/init.dart
+18
-4
No files found.
packages/flutter_tools/lib/src/commands/init.dart
View file @
e8e65446
...
...
@@ -201,14 +201,27 @@ void main() {
runApp(
new MaterialApp(
title: "Flutter Demo",
routes: {
routes:
<String, RouteBuilder>
{
'
/
': (RouteArguments args) => new FlutterDemo()
}
)
);
}
class FlutterDemo extends StatelessComponent {
class FlutterDemo extends StatefulComponent {
@override
State createState() => new FlutterDemoState();
}
class FlutterDemoState extends State {
int counter = 0;
void incrementCounter() {
setState(() {
counter++;
});
}
Widget build(BuildContext context) {
return new Scaffold(
toolBar: new ToolBar(
...
...
@@ -216,13 +229,14 @@ class FlutterDemo extends StatelessComponent {
),
body: new Material(
child: new Center(
child: new Text("
Hello world!
")
child: new Text("
Button tapped
$counter
times.
")
)
),
floatingActionButton: new FloatingActionButton(
child: new Icon(
icon: '
content
/
add
'
)
),
onPressed: incrementCounter
)
);
}
...
...
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