title: How to handle Location Service from Flutter Web App?
body: <p>I have created a Flutter Web App and tried to embed into my iOS App as a WebView. It crashed when the user turned off the device Location Services.</p>
  <p>Hope anyone can help or give suggestions I can do for that?</p>
  <p>Here is the error exception:</p>
  <blockquote>
  <p>PlatformException(LOCATION_SERVICES NOT SUPPORTED, Location services are not supported on this browser., null, null)</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/PY0Ic.png" rel="nofollow noreferrer">Error console</a></p>
  <pre><code>bool serviceEnabled;
                      LocationPermission permission;
                      
                      try {
                        if (!kIsWeb) {
                          serviceEnabled =
                              await Geolocator.isLocationServiceEnabled();
                          if (!serviceEnabled) {
                            print(&quot;Location services are disabled&quot;);
                          }
  
                          permission = await Geolocator.checkPermission();
                          if (permission == LocationPermission.denied) {
                            print(&quot;Location permission denied&quot;);
                            permission = await Geolocator.requestPermission();
                            if (permission == LocationPermission.deniedForever) {
                              print(&quot;Location permission denied forever&quot;);
                            }
                          }
                        }
  
                        Position position = await Geolocator.getCurrentPosition();
                        print('User Current Location $position');
                      } catch (e) {
                        print(
                            &quot;Failed to ask for user location services / permission $e&quot;);
                      }
  </code></pre>