Skip to content

Commit 444ab39

Browse files
authored
Update and rename main.dart to main.dart.txt
1 parent 4af6a84 commit 444ab39

File tree

2 files changed

+60
-111
lines changed

2 files changed

+60
-111
lines changed

0-First-Project/lib/main.dart

Lines changed: 0 additions & 111 deletions
This file was deleted.

0-First-Project/lib/main.dart.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import 'package:flutter/material.dart';
2+
3+
void main() => runApp(MyApp());
4+
5+
class MyApp extends StatelessWidget {
6+
@override
7+
Widget build(BuildContext context) {
8+
return MaterialApp(
9+
title: 'Flutter Demo',
10+
theme: ThemeData( primarySwatch: Colors.blue ),
11+
home: MyHomePage(title: 'Flutter Demo Home Page'),
12+
);
13+
}
14+
}
15+
16+
class MyHomePage extends StatefulWidget {
17+
MyHomePage({Key key, this.title}) : super(key: key);
18+
final String title;
19+
20+
@override
21+
_MyHomePageState createState() => _MyHomePageState();
22+
}
23+
24+
class _MyHomePageState extends State<MyHomePage> {
25+
int _counter = 0;
26+
27+
void _incrementCounter() {
28+
setState(() {
29+
_counter++;
30+
});
31+
}
32+
33+
@override
34+
Widget build(BuildContext context) {
35+
return Scaffold(
36+
appBar: AppBar(
37+
title: Text(widget.title),
38+
),
39+
body: Center(
40+
child: Column(
41+
mainAxisAlignment: MainAxisAlignment.center,
42+
children: <Widget>[
43+
Text(
44+
'You have pushed the button this many times:',
45+
),
46+
Text(
47+
'$_counter',
48+
style: Theme.of(context).textTheme.display1,
49+
),
50+
],
51+
),
52+
),
53+
floatingActionButton: FloatingActionButton(
54+
onPressed: _incrementCounter,
55+
tooltip: 'Increment',
56+
child: Icon(Icons.add),
57+
),
58+
);
59+
}
60+
}

0 commit comments

Comments
 (0)