googlePlayServicesAvailability method

  1. @override
Future<GooglePlayServicesAvailability?> googlePlayServicesAvailability()
override

Implementation

@override
Future<GooglePlayServicesAvailability?>
    googlePlayServicesAvailability() async {
  final String result =
      await methodChannel.invokeMethod('checkGooglePlayServicesAvailability');

  switch (result) {
    case 'success':
      return GooglePlayServicesAvailability.success;
    case 'service_missing':
      return GooglePlayServicesAvailability.serviceMissing;
    case 'service_updating':
      return GooglePlayServicesAvailability.serviceUpdating;
    case 'service_version_update_required':
      return GooglePlayServicesAvailability.serviceVersionUpdateRequired;
    case 'service_disabled':
      return GooglePlayServicesAvailability.serviceDisabled;
    case 'service_invalid':
      return GooglePlayServicesAvailability.serviceInvalid;
  }

  return null;
}