Instead of using: _permissionGranted = await location.hasPermission(); use: _permissionGranted = await location.requestPermission();
for the web version