Skip to content

Commit 519896f

Browse files
committed
lesson-24
1 parent 7eaea20 commit 519896f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

world_time_app/lib/pages/choose_location.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,18 @@ class ChooseLocation extends StatefulWidget {
66
}
77

88
class _ChooseLocationState extends State<ChooseLocation> {
9+
10+
int counter = 0;
11+
12+
@override
13+
void initState() {
14+
super.initState();
15+
print('initState function ran');
16+
}
17+
918
@override
1019
Widget build(BuildContext context) {
20+
print('build function ran');
1121
return Scaffold(
1222
backgroundColor: Colors.grey[200],
1323
appBar: AppBar(
@@ -16,6 +26,14 @@ class _ChooseLocationState extends State<ChooseLocation> {
1626
centerTitle: true,
1727
elevation: 0,
1828
),
29+
body: RaisedButton(
30+
onPressed: (){
31+
setState(() {
32+
counter += 1;
33+
});
34+
},
35+
child: Text('$counter'),
36+
)
1937
);
2038
}
2139
}

world_time_app/lib/pages/home.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Home extends StatefulWidget {
66
}
77

88
class _HomeState extends State<Home> {
9+
910
@override
1011
Widget build(BuildContext context) {
1112
return Scaffold(

0 commit comments

Comments
 (0)