providerState property

Future<ProviderChangeEvent> get providerState

Get current state of location-services, including authorization status.

See ProviderChangeEvent

Implementation

static Future<ProviderChangeEvent> get providerState async {
  Completer completer = Completer<ProviderChangeEvent>();

  _methodChannel.invokeMapMethod('getProviderState').then((Map? data) {
    completer.complete(ProviderChangeEvent(data!));
  }).catchError((e) {
    completer.completeError(Error(e));
  });

  return completer.future as FutureOr<ProviderChangeEvent>;
}