medyas / flutter_qiblah

Flutter Qiblah is a plugin that allows you to display Qiblah direction in you app with support for both Android and iOS.

Home Page:https://pub.dev/packages/flutter_qiblah

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unknown Location Service error

n2ng-dev opened this issue · comments

commented

I got Error Unknown Location Service error,
Simulator Screen Shot - iPhone 11 Pro Max - 2020-04-24 at 18 26 02

As i see in the screenshot, you running on iOS, have you added the permission in infop.list ?
Also are you running on an simulator ?

The part of the code responsible for this is :
it seem like it detects that you have enabled the Location Service, but its not working

    StreamBuilder(
        stream: stream,
        builder: (context, AsyncSnapshot<LocationStatus> snapshot) {
          if (snapshot.connectionState == ConnectionState.waiting)
            return LoadingIndicator();
          if (snapshot.data.enabled == true) {
            switch (snapshot.data.status) {
              case GeolocationStatus.granted:
                return QiblahCompassWidget();

              case GeolocationStatus.denied:
                return LocationErrorWidget(
                  error: "Location service permission denied",
                  callback: _checkLocationStatus,
                );
              case GeolocationStatus.disabled:
                return LocationErrorWidget(
                  error: "Location service disabled",
                  callback: _checkLocationStatus,
                );
              case GeolocationStatus.unknown:
                return LocationErrorWidget(
                  error: "Unknown Location service error",
                  callback: _checkLocationStatus,
                );
              default:
                return Container();
            }
          } else {
            return LocationErrorWidget(
              error: "Please enable Location service",
              callback: _checkLocationStatus,
            );
          }
        },
      )

I am closing this, as no information is provided.