You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[google_sign_in_web] Fix race condition on init. (#2455)
* [google_sign_in_web] Wait for Auth2 to be really ready.
The Auth object that `.init()` returns may not be fully ready by the time
we start calling methods on it; however it has a `.then()` method that
gets called when it is *really* ready to go.
* Add a completer to signal when Auth2 is ready.
* Throw StateError synchronously if .initialized is checked before calling .init()
* Move auth2-dependent init to the `then` method.
* onSuccess, complete the auth2 ready future.
* onError, throw a PlatformException. This is normally triggered when
the domain:port of the web app hasn't been whitelisted on the google
sign in console, and things like that. Useful for debugging.
* Update README with latest setup instructions.
Copy file name to clipboardExpand all lines: packages/google_sign_in/google_sign_in_web/README.md
+21-9
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,16 @@ The web implementation of [google_sign_in](https://pub.dev/google_sign_in/google
5
5
## Usage
6
6
7
7
### Import the package
8
-
To use this plugin, follow the [plugin installation instructions](https://pub.dartlang.org/packages/google_sign_in#pub-pkg-tab-installing).
9
8
10
-
Remember that for web plugins you need to depend both on the "native" version that provides the Dart interface that you'll use in your app), and the "web" version, that provides the implementation of the plugin for the web platform.
9
+
This package is the endorsed implementation of `google_sign_in` for the web platform since version `4.1.0`, so it gets automatically added to your dependencies by depending on `google_sign_in: ^4.1.0`.
11
10
12
-
This is what the above means to your `pubspec.yaml`:
11
+
No modifications to your pubspec.yaml should be required in a recent enough version of Flutter (`>=1.12.13+hotfix.4`):
13
12
14
-
```
13
+
```yaml
15
14
...
16
15
dependencies:
17
16
...
18
-
google_sign_in: ^4.0.14
19
-
google_sign_in_web: ^0.8.0
17
+
google_sign_in: ^4.1.0
20
18
...
21
19
...
22
20
```
@@ -28,8 +26,8 @@ First, go through the instructions [here](https://developers.google.com/identity
28
26
On your `web/index.html` file, add the following `meta` tag, somewhere in the
Read the rest of the instructions if you need to add extra APIs (like Google People API).
@@ -74,7 +72,21 @@ Find the example wiring in the [Google sign-in example application](https://gith
74
72
75
73
See the [google_sign_in.dart](https://github.com/flutter/plugins/blob/master/packages/google_sign_in/google_sign_in/lib/google_sign_in.dart) for more API details.
76
74
75
+
## Contributions and Testing
76
+
77
+
Tests are a crucial to contributions to this package. All new contributions should be reasonably tested.
78
+
79
+
In order to run tests in this package, do:
80
+
81
+
```
82
+
flutter test --platform chrome -j1
83
+
```
84
+
85
+
Contributions to this package are welcome. Read the [Contributing to Flutter Plugins](https://github.com/flutter/plugins/blob/master/CONTRIBUTING.md) guide to get started.
0 commit comments