Flutterlocation: It doesn't work on web

Created on 14 Apr 2020  路  8Comments  路  Source: Lyokone/flutterlocation

Location location = new Location();
bool _serviceEnabled;
PermissionStatus _permissionGranted;
LocationData _locationData;
_serviceEnabled =
  await location.serviceEnabled();
if (!_serviceEnabled) {
  _serviceEnabled =
  await location.requestService();
  if (!_serviceEnabled) {
    return;
  }
}
_permissionGranted =
  await location.hasPermission();
if (_permissionGranted == PermissionStatus.denied) {
  _permissionGranted = await location
    .requestPermission();
  if (_permissionGranted !=
    PermissionStatus.granted) {
  return;
  }
}
_locationData = await location.getLocation();

This is an example same as what you gave me in readme.
But When I run it on web in debug mode,it throw a error:
image
And after that,when I call it again,it will never return.

bug inactive

Most helpful comment

Anything new?

All 8 comments

Same error here kind of blocking... Any workaround ?

Working in chrome but not in Safari

Same error here kind of blocking... Any workaround ?

Working in chrome but not in Safari

Haha,mine doesn't work in chrome and edge.

Are you able to launch the example app ? The implementation was tested with it :)

Are you able to launch the example app ? The implementation was tested with it :)

Let me have a try haha.

Are you able to launch the example app ? The implementation was tested with it :)

I had a try.
image
I think it still doesn't work in the example.

Anything new?

Anything new?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RomanJos picture RomanJos  路  4Comments

magicznyadrian picture magicznyadrian  路  3Comments

fre391 picture fre391  路  4Comments

Gintasz picture Gintasz  路  9Comments

LinusU picture LinusU  路  3Comments