File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
Expand file tree Collapse file tree 1 file changed +18
-1
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+ @override
10+ int counter = 0 ;
11+
12+ void initState () {
13+ // TODO: implement initState
14+ super .initState ();
15+ print ('initState function has been run' );
16+ }
17+
918 @override
1019 Widget build (BuildContext context) {
20+ print ('build function has been run' );
1121 return Scaffold (
1222 backgroundColor: Colors .grey[200 ],
1323 appBar: AppBar (
@@ -16,7 +26,14 @@ class _ChooseLocationState extends State<ChooseLocation> {
1626 title: Text ('Choose a location' ),
1727 elevation: 0 ,
1828 ),
19- body: Text ('Choose Location Screen' ),
29+ body: RaisedButton (
30+ onPressed: () {
31+ setState (() {
32+ counter++ ;
33+ });
34+ },
35+ child: Text ('Counter is: $counter ' ),
36+ ),
2037 );
2138 }
2239}
You can’t perform that action at this time.
0 commit comments