Flutter Google Api Availability Plugin
A Flutter plugin to check the availability of Google Play services on the current device.
- 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:
dependencies: 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.
- Built-in types and core primitives for a Flutter application. [...]
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- Classes and utilities that supplement the collection support in dart:core. [...]
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- Built-in types, collections, and other core functionality for every Dart program. [...]
- Interact with developer tools such as the debugger and inspector. [...]
- Mathematical constants and functions, plus a random number generator. [...]
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]