Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Allow removal of platform instance for testing purposes #41

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
paulppn merged 3 commits into Baseflow:main from JeroenWeener:main
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions google_api_availability_platform_interface/CHANGELOG.md
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.1

* Adds `removeInstance` to `GoogleApiAvailabilityPlatform` for testing purposes.

## 1.0.0

* Extracts the common platform interface from the google_api_availability package.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:google_api_availability_platform_interface/google_api_availability_platform_interface.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

Expand Down Expand Up @@ -33,6 +34,13 @@ abstract class GoogleApiAvailabilityPlatform extends PlatformInterface {
_instance = instance;
}

/// Removes the registered instance of the [GoogleApiAvailabilityPlatform] class.
///
/// This method is exposed for testing purposes only and should not be used by
/// clients of the plugin.
@visibleForTesting
static removeInstance() => _instance = null;
Copy link
Member

@mvanbeusekom mvanbeusekom Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific use case for this?

I have not seen it in any of the other plugins and from the top of my head I cannot really think of a specific case where this is needed. Would like to hear if there is one.

Copy link
Contributor Author

@JeroenWeener JeroenWeener Mar 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is included so we can test whether the methods that are exposed to users of the plugin correctly throw if no platform is registered. This way we can emulate the scenario where the app runs on an unsupported platform.


/// Returns the connection status of Google Play Service.
///
/// Optionally, you can also show an error dialog if the connection status is
Expand Down
2 changes: 1 addition & 1 deletion google_api_availability_platform_interface/pubspec.yaml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A common platform interface for the google_api_availability plugin.
repository: https://github.com/baseflow/flutter-google-api-availability/tree/main/google_api_availability_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 1.0.0
version: 1.0.1

dependencies:
flutter:
Expand Down

AltStyle によって変換されたページ (->オリジナル) /