Visitar URL original
[extension_google_sign_in_as_googleapis_auth] Move from flutter/plugins. by ditman · Pull Request #301 · flutter/packages · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f78546c
[google_sign_in] Bridge google_sign_in and googleapis. (#2824)
ditman Jul 14, 2020
fbceb5f
Make package:e2e a relative reference (#2889)
dnfield Jul 24, 2020
c04e936
Rename e2e -> integration_test (#2918)
dnfield Aug 19, 2020
dc9e48e
Standardize LICENSE body text formatting (#2992)
stuartmorgan-g Sep 3, 2020
698ca3c
Add deprecation suppression for plugins marked with -Werror (#3072)
xster Sep 23, 2020
878c10a
Update android sdk version to 29 for all mobile plugins. (#3042)
Oct 14, 2020
820b186
[d-g] Update Flutter SDK constraint (#3321)
mit-mit Dec 11, 2020
90adf95
Fix outdated links across a number of markdown files (#3276)
kevmoo Dec 18, 2020
a77819f
Update obsolete button refs in plugin examples (#3395)
HansMuller Jan 7, 2021
a24c98a
Update pubspecs (#3534)
mit-mit Feb 10, 2021
0621213
Added comment about path depenendencies (#3542)
jonasfj Feb 12, 2021
abb8933
[extension_google_sign_in_as_googleapis_auth] Migrate to null safety …
stuartmorgan-g Feb 26, 2021
69413ad
Move to flutter/packages
ditman Mar 5, 2021
0796f29
Merge branch 'master' of /usr/local/google/home/dit/github/moving-ext…
ditman Mar 5, 2021
ab9eb3b
Make analyzer happy.
ditman Mar 5, 2021
1d167e7
Ignore generated files from example
ditman Mar 5, 2021
c05c680
Import from googleapis_auth.dart
ditman Mar 8, 2021
52bace7
Bump version and changelog.
ditman Mar 8, 2021
8256805
Do not bump major version
ditman Mar 8, 2021
eba7f33
Update example to sound null safety
ditman Mar 8, 2021
42ca626
Update README
ditman Mar 8, 2021
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
Update example to sound null safety
  • Loading branch information
ditman committed Mar 8, 2021
commit eba7f33ff0b05e1d6a21524369a9da6c2db6f691
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class SignInDemo extends StatefulWidget {

/// The state of the main widget.
class SignInDemoState extends State<SignInDemo> {
GoogleSignInAccount _currentUser;
String _contactText;
GoogleSignInAccount? _currentUser;
String? _contactText;

@override
void initState() {
super.initState();
_googleSignIn.onCurrentUserChanged.listen((GoogleSignInAccount account) {
_googleSignIn.onCurrentUserChanged.listen((GoogleSignInAccount? account) {
setState(() {
_currentUser = account;
});
Expand All @@ -57,14 +57,14 @@ class SignInDemoState extends State<SignInDemo> {
});

final PeopleServiceApi peopleApi =
PeopleServiceApi(await _googleSignIn.authenticatedClient());
PeopleServiceApi((await _googleSignIn.authenticatedClient())!);
final ListConnectionsResponse response =
await peopleApi.people.connections.list(
'people/me',
personFields: 'names',
);

final String firstNamedContactName =
final String? firstNamedContactName =
_pickFirstNamedContact(response.connections);

setState(() {
Expand All @@ -76,18 +76,16 @@ class SignInDemoState extends State<SignInDemo> {
});
}

String _pickFirstNamedContact(List<Person> connections) {
String? _pickFirstNamedContact(List<Person>? connections) {
return connections
?.firstWhere(
(Person person) => person.names != null,
orElse: () => null,
)
?.names
.names
?.firstWhere(
(Name name) => name.displayName != null,
orElse: () => null,
)
?.displayName;
.displayName;
}

Future<void> _handleSignIn() async {
Expand All @@ -107,10 +105,10 @@ class SignInDemoState extends State<SignInDemo> {
children: <Widget>[
ListTile(
leading: GoogleUserCircleAvatar(
identity: _currentUser,
identity: _currentUser!,
),
title: Text(_currentUser.displayName ?? ''),
subtitle: Text(_currentUser.email ?? ''),
title: Text(_currentUser!.displayName ?? ''),
subtitle: Text(_currentUser!.email),
),
const Text('Signed in successfully.'),
Text(_contactText ?? ''),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: extension_google_sign_in_example
description: Example of Google Sign-In plugin and googleapis.
publish_to: none

dependencies:
extension_google_sign_in_as_googleapis_auth:
Expand All @@ -12,7 +13,7 @@ dependencies:
flutter:
sdk: flutter
google_sign_in: ^5.0.0
googleapis: ^1.0.0
googleapis: ^2.0.0

dev_dependencies:
pedantic: ^1.10.0
Expand All @@ -21,5 +22,5 @@ flutter:
uses-material-design: true

environment:
sdk: ">=2.0.0-dev.28.0 <3.0.0"
flutter: ">=1.12.13+hotfix.4"
sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.20.0"