Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
968563c
Move Android code to separate folder
JeroenWeener Mar 9, 2023
556a6b4
Copy gradle-wrapper.properties
JeroenWeener Mar 10, 2023
cb85f4a
Register Android implementation in pubspec.yaml
JeroenWeener Mar 10, 2023
6d17da1
Update pubspec.yaml
JeroenWeener Mar 10, 2023
3b1dcdc
Add missing newline to `build.gradle`
JeroenWeener Mar 13, 2023
8f4ffe1
Configure CI to run on stable Flutter version
mvanbeusekom Mar 9, 2023
df9c316
Revert "Add platform interface"
mvanbeusekom Mar 9, 2023
ef76bcf
Move app-facing code to separate folder
JeroenWeener Mar 9, 2023
7959f39
Revert "Merge pull request #35 from Baseflow/revert-34-enhancement/pl…
JeroenWeener Mar 9, 2023
61d77a6
Update CONTRIBUTING.md
JeroenWeener Mar 9, 2023
aecc12e
Move `analysis_options.yaml` to root folder
JeroenWeener Mar 10, 2023
d59ea45
Move Android code to separate folder
JeroenWeener Mar 9, 2023
cf0435b
Copy gradle-wrapper.properties
JeroenWeener Mar 10, 2023
3b2e58e
Register Android implementation in pubspec.yaml
JeroenWeener Mar 10, 2023
de46616
Update pubspec.yaml
JeroenWeener Mar 10, 2023
d2b8639
Update build.gradle
JeroenWeener Mar 13, 2023
bfe99c4
Merge remote-tracking branch 'upstream/main' into enhancement/platfor…
JeroenWeener Mar 13, 2023
2ba97a8
Merge branch 'enhancement/platform-android' of github.com:jeroenweene…
JeroenWeener Mar 13, 2023
af356b4
Remove `example-directory` from google_api_availability_android.yaml
JeroenWeener Mar 13, 2023
029c540
Update google_api_availability_android.yaml
JeroenWeener Mar 13, 2023
fe69b63
Update google_api_availability.yaml
JeroenWeener Mar 13, 2023
ed948fb
Bump `actions/checkout` and `subosito/flutter-action` versions
JeroenWeener Mar 13, 2023
bcc4256
Update google_api_availability.yaml
JeroenWeener Mar 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move app-facing code to separate folder
  • Loading branch information
JeroenWeener committed Mar 13, 2023
commit ef76bcf59fb30a772ac4b20bd7ce6ca24590f3d6
61 changes: 8 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,11 @@
# Flutter Google Api Availability Plugin
# Flutter Google API Availability plugin

[![pub package](https://img.shields.io/pub/v/google_api_availability.svg)](https://pub.dartlang.org/packages/google_api_availability) ![Build status](https://github.com/Baseflow/flutter-google-api-availability/workflows/google_api_availability/badge.svg?branch=master) [![codecov](https://codecov.io/gh/Baseflow/flutter-google-api-availability/branch/master/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter-google-api-availability)
The Flutter Google API Availability plugin is built following the federated plugin architecture. A detailed explanation of the federated plugin concept can be found in the [Flutter documentation](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins). This means the Google API Availability plugin is separated into the following packages:

A Flutter plugin to check the availability of Google Play services on the current device.
1. [`google_api_availability`][1]: the app facing package. This is the package users depend on to use the plugin in their project. For details on how to use the [`google_api_availability`][1] plugin you can refer to its [README.md][2] file.
2. [`google_api_availability_platform_interface`][3]: this package declares the interface which all platform packages must implement to support the app-facing package. Instructions on how to implement a platform package can be found in the [README.md][4] of the [`google_api_availability_platform_interface`][3] package.

## Features

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

## Usage

To use this plugin, add `google_api_availability` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). For example:

```yaml
dependencies:
google_api_availability: ^3.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](https://github.com/flutter/flutter/issues/16049) for help on integration.

## API

### GoogleApiAvailability

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](https://developers.google.com/android/guides/setup)).

``` dart
import `package:google_api_availability/google_api_availability.dart`;

GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.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:

``` dart
import `package:google_api_availability/google_api_availability.dart`;

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

**Note that on iOS this will always return `notAvailableOnPlatform`!**

See also the [example](example/lib/main.dart) project for a complete implementation.

## Issues

Please file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/BaseflowIT/flutter-google-api-availability/issues) 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](CONTRIBUTING.md) and send us your [pull request](https://github.com/BaseflowIT/flutter-google-api-availability/pulls).

## Author

This Google Api Availability plugin for Flutter is developed by [Baseflow](https://baseflow.com). You can contact us at <[email protected]>
[1]: ./google_api_availability
[2]: ./google_api_availability/README.md
[3]: ./google_api_availability_platform_interface
[4]: ./google_api_availability_platform_interface/README.md
File renamed without changes.
21 changes: 21 additions & 0 deletions google_api_availability/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Baseflow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
56 changes: 56 additions & 0 deletions google_api_availability/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Flutter Google Api Availability Plugin

[![pub package](https://img.shields.io/pub/v/google_api_availability.svg)](https://pub.dartlang.org/packages/google_api_availability) ![Build status](https://github.com/Baseflow/flutter-google-api-availability/workflows/google_api_availability/badge.svg?branch=master) [![codecov](https://codecov.io/gh/Baseflow/flutter-google-api-availability/branch/master/graph/badge.svg)](https://codecov.io/gh/Baseflow/flutter-google-api-availability)

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

## Features

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

## Usage

To use this plugin, add `google_api_availability` as a [dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). For example:

```yaml
dependencies:
google_api_availability: ^3.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](https://github.com/flutter/flutter/issues/16049) for help on integration.

## API

### GoogleApiAvailability

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](https://developers.google.com/android/guides/setup)).

``` dart
import `package:google_api_availability/google_api_availability.dart`;

GooglePlayServicesAvailability availability = await GoogleApiAvailability.instance.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:

``` dart
import `package:google_api_availability/google_api_availability.dart`;

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

**Note that on iOS this will always return `notAvailableOnPlatform`!**

See also the [example](example/lib/main.dart) project for a complete implementation.

## Issues

Please file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/BaseflowIT/flutter-google-api-availability/issues) 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](CONTRIBUTING.md) and send us your [pull request](https://github.com/BaseflowIT/flutter-google-api-availability/pulls).

## Author

This Google API Availability plugin for Flutter is developed by [Baseflow](https://baseflow.com). You can contact us at <[email protected]>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'dart:async';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:google_api_availability/src/models/google_play_services_availability.dart';

import '../google_api_availability.dart';

/// Flutter plugin to verify if Google Play Services are installed on the
/// device.
Expand Down
File renamed without changes.