google_api_availability 1.0.4

  • Example
  • Installing
  • Versions
  • 91

Flutter Google Api Availability Plugin

pub package

A Flutter plugin to check the availability of Google Play services on the current device.

BranchBuild Status
developBuild Status
masterBuild Status


  • Check the availability of Google Play services (on Android only).


To use this plugin, add google_api_availability as a dependency in your pubspec.yaml file. For example:

  google_api_availability: '^1.0.2'

NOTE: There's a known issue with integrating plugins that use Swift into a Flutter project created with the Objective-C template. See issue Flutter#16049 for help on integration.



To check the availability of Google Play services on the current device, you can use the checkGooglePlayServicesAvailability method. This could be helpful to provide a more friendly experience to users in case an user-action is required to enable support for Google Play services (More information can be found here).

import `package:google_api_availability/google_api_availability.dart`;

GooglePlayServicesAvailability availability = await GoogleApiAvailability().checkGooglePlayServicesAvailability();

If you want to show a dialog by the Android system with more information and show a possible fix to the user you can do:

import `package:google_api_availability/google_api_availability.dart`;

GooglePlayServicesAvailability availability = await GoogleApiAvailability().checkGooglePlayServicesAvailability(true);

Note that on iOS this will always return false!

See also the example project for a complete implementation.


Please file any issues, bugs or feature request as an issue on our GitHub page.

Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.


This Google Api Availability plugin for Flutter is developed by Baseflow. You can contact us at


  • Update used Kotlin and Gradle versions.


  • Bug fix that is introduced due to breaking changes in Flutter version 0.9.6.


  • Add additional iOS configuration to make sure it compiles correcty using Swift 4.1


  • Add iOS implementation that returns false


  • Initial release


import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:google_api_availability/google_api_availability.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  GooglePlayServicesAvailability _playStoreAvailability =

  void initState() {

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> checkPlayServices([bool showDialog = false]) async {
    GooglePlayServicesAvailability playStoreAvailability;
    // Platform messages may fail, so we use a try/catch PlatformException.
    try {
      playStoreAvailability = await GoogleApiAvailability()
    } on PlatformException {
      playStoreAvailability = GooglePlayServicesAvailability.unknown;

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _playStoreAvailability = playStoreAvailability;

  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Plugin example app'),
          body: new ListView(
            children: <Widget>[
              new MaterialButton(
                onPressed: () => checkPlayServices(),
                child: new Text("Get PlayServices availability"),
              new MaterialButton(
                onPressed: () => checkPlayServices(true),
                    new Text("Get PlayServices availability with fix dialog"),
                color: Colors.redAccent,
              new Center(
                  child: Text(
                      'Google Play Store status: ${_playStoreAvailability.toString().split('.').last}\n')),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  google_api_availability: ^1.0.4

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:google_api_availability/google_api_availability.dart';
Version Uploaded Documentation Archive
1.0.4 Oct 10, 2018 Go to the documentation of google_api_availability 1.0.4 Download google_api_availability 1.0.4 archive
1.0.3 Oct 5, 2018 Go to the documentation of google_api_availability 1.0.3 Download google_api_availability 1.0.3 archive
1.0.2 Sep 18, 2018 Go to the documentation of google_api_availability 1.0.2 Download google_api_availability 1.0.2 archive
1.0.1 Sep 17, 2018 Go to the documentation of google_api_availability 1.0.1 Download google_api_availability 1.0.1 archive
1.0.0 Sep 4, 2018 Go to the documentation of google_api_availability 1.0.0 Download google_api_availability 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
meta ^1.1.6 1.1.6 1.1.7
Transitive dependencies
collection 1.14.11
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8