Skip to content

[google_sign_in] Adopt code excerpts in README #5521

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
merged 8 commits into from
Dec 13, 2023

Conversation

mike-v2
Copy link
Contributor

@mike-v2 mike-v2 commented Nov 29, 2023

Improves README example and updates it to use code excerpts.

Part of flutter/flutter#102679

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@mike-v2
Copy link
Contributor Author

mike-v2 commented Nov 29, 2023

I was able to get the code excerpts from the example/lib/main.dart file, but they didn't always appear verbatim. Let me know if the differences outweigh the benefit of not creating an extra file, or if I should tweak the example file to better match the original README snippets.
If you do want me to create a separate file, please advise on how to structure the tests, since it seems the README code is mainly making API calls.

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

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

LGTM with some minor changes, thanks!

(Several of these are actually not very good code, like the global sign-in object, but not-great code that we know compiles is still an improvement!)

@@ -66,25 +66,32 @@ To use this plugin, follow the

Add the following import to your Dart code:

<?code-excerpt "example/lib/main.dart (Import)"?>
```dart
import 'package:google_sign_in/google_sign_in.dart';
```
Copy link
Contributor

Choose a reason for hiding this comment

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

We can just remove from 67 to here; this information is in the installation page instructions.

@@ -9,12 +9,15 @@ import 'dart:convert' show json;

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
// #docregion Import
Copy link
Contributor

Choose a reason for hiding this comment

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

(And remove this.)

@@ -59,7 +63,9 @@ class _SignInDemoState extends State<SignInDemo> {
bool isAuthorized = account != null;
// However, in the web...
if (kIsWeb && account != null) {
// #docregion CanAccessScopes
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put this just above line 62 instead; it's all relevant to what the example is talking about.

isAuthorized = await _googleSignIn.canAccessScopes(scopes);
// #enddocregion CanAccessScopes
Copy link
Contributor

Choose a reason for hiding this comment

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

And then this will move down one line.

@stuartmorgan-g
Copy link
Contributor

@tarrinneal for second review once the changes are made.

Remove Import snippet since it's in the installation page instructions

Expand CanAccessScopes snippet to include additional pertinent information
Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

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

one nit

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 7, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 7, 2023
Copy link
Contributor

auto-submit bot commented Dec 7, 2023

auto label is removed for flutter/packages/5521, due to - The status or check suite Windows_x64 dart_unit_tests_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label.

@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 8, 2023
Copy link
Contributor

auto-submit bot commented Dec 8, 2023

auto label is removed for flutter/packages/5521, due to - The status or check suite Mac_arm64 ios_platform_tests_shard_2 master has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 8, 2023
@tarrinneal tarrinneal added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2023
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 11, 2023
Copy link
Contributor

auto-submit bot commented Dec 11, 2023

auto label is removed for flutter/packages/5521, due to - The status or check suite Linux dart_unit_test_shard_1 master has failed. Please fix the issues identified (or deflake) before re-applying this label.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 13, 2023
@auto-submit auto-submit bot merged commit 12b3d59 into flutter:main Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 14, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 14, 2023
flutter/packages@b5958e2...1151191

2023-12-14 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.22.8 to 3.22.11 (flutter/packages#5674)
2023-12-13 [email protected] [ci][web] Ignore always_specify_types for JSArray. (flutter/packages#5669)
2023-12-13 [email protected] [tool] Add support for `.java`, `.gradle`, `.sh`, and `.m` filesâ�¦ (flutter/packages#5567)
2023-12-13 [email protected] [google_sign_in] Update (web) example app. (flutter/packages#5634)
2023-12-13 [email protected] [path_provider] De-flake getExternalStorageDirectories test (flutter/packages#5628)
2023-12-13 [email protected] [google_sign_in_web] Stop relying on framework internals. (flutter/packages#5660)
2023-12-13 [email protected] [Android] Bump Gradle version to 7.6.3 (flutter/packages#5522)
2023-12-13 [email protected] [google_sign_in] Adopt code excerpts in README (flutter/packages#5521)
2023-12-13 [email protected] [css_colors] Adopt code excerpts in README (flutter/packages#5478)
2023-12-13 [email protected] [webview_flutter] Support for handling basic authentication requests (Android) (flutter/packages#5454)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: google_sign_in
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants