File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,18 @@ class ChooseLocation extends StatefulWidget {
66}
77
88class _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}
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ class Home extends StatefulWidget {
66}
77
88class _HomeState extends State <Home > {
9+
910 @override
1011 Widget build (BuildContext context) {
1112 return Scaffold (
You can’t perform that action at this time.
0 commit comments