@@ -17,17 +17,21 @@ void main() {
1717
1818/// Example [Widget] showing the functionalities of the geolocator plugin.
1919class GeolocatorWidget extends StatefulWidget {
20- /// Creates a new GeolocatorWidget.
21- const GeolocatorWidget ({Key ? key}) : super (key: key);
20+ /// Creates a [PermissionHandlerWidget] .
21+ const GeolocatorWidget ({
22+ super .key,
23+ });
2224
23- /// Utility method to create a page with the Baseflow templating.
25+ /// Create a page containing the functionality of this plugin
2426 static ExamplePage createPage () {
2527 return ExamplePage (
2628 Icons .location_on, (context) => const GeolocatorWidget ());
2729 }
2830
2931 @override
30- _GeolocatorWidgetState createState () => _GeolocatorWidgetState ();
32+ State <GeolocatorWidget > createState () {
33+ return _GeolocatorWidgetState ();
34+ }
3135}
3236
3337class _GeolocatorWidgetState extends State <GeolocatorWidget > {
@@ -75,26 +79,26 @@ class _GeolocatorWidgetState extends State<GeolocatorWidget> {
7579 },
7680 itemBuilder: (context) => [
7781 const PopupMenuItem (
78- child: Text ("Get Location Accuracy" ),
7982 value: 1 ,
83+ child: Text ("Get Location Accuracy" ),
8084 ),
8185 if (Platform .isIOS)
8286 const PopupMenuItem (
83- child: Text ("Request Temporary Full Accuracy" ),
8487 value: 2 ,
88+ child: Text ("Request Temporary Full Accuracy" ),
8589 ),
8690 const PopupMenuItem (
87- child: Text ("Open App Settings" ),
8891 value: 3 ,
92+ child: Text ("Open App Settings" ),
8993 ),
9094 if (Platform .isAndroid)
9195 const PopupMenuItem (
92- child: Text ("Open Location Settings" ),
9396 value: 4 ,
97+ child: Text ("Open Location Settings" ),
9498 ),
9599 const PopupMenuItem (
96- child: Text ("Clear" ),
97100 value: 5 ,
101+ child: Text ("Clear" ),
98102 ),
99103 ],
100104 );
@@ -150,27 +154,27 @@ class _GeolocatorWidgetState extends State<GeolocatorWidget> {
150154 mainAxisAlignment: MainAxisAlignment .end,
151155 children: [
152156 FloatingActionButton (
153- child: (_positionStreamSubscription == null ||
154- _positionStreamSubscription! .isPaused)
155- ? const Icon (Icons .play_arrow)
156- : const Icon (Icons .pause),
157157 onPressed: _toggleListening,
158158 tooltip: (_positionStreamSubscription == null )
159159 ? 'Start position updates'
160160 : _positionStreamSubscription! .isPaused
161161 ? 'Resume'
162162 : 'Pause' ,
163163 backgroundColor: _determineButtonColor (),
164+ child: (_positionStreamSubscription == null ||
165+ _positionStreamSubscription! .isPaused)
166+ ? const Icon (Icons .play_arrow)
167+ : const Icon (Icons .pause),
164168 ),
165169 sizedBox,
166170 FloatingActionButton (
167- child: const Icon (Icons .my_location),
168171 onPressed: _getCurrentPosition,
172+ child: const Icon (Icons .my_location),
169173 ),
170174 sizedBox,
171175 FloatingActionButton (
172- child: const Icon (Icons .bookmark),
173176 onPressed: _getLastKnownPosition,
177+ child: const Icon (Icons .bookmark),
174178 ),
175179 ],
176180 ),
0 commit comments