2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
+ import 'package:flutter/widgets.dart' ;
5
6
import 'package:quiver/core.dart' ;
6
7
7
8
/// Default configuration options to use when signing in.
@@ -22,6 +23,42 @@ enum SignInOption {
22
23
games
23
24
}
24
25
26
+ /// The parameters to use when initializing the sign in process.
27
+ ///
28
+ /// See:
29
+ /// https://developers.google.com/identity/sign-in/web/reference#gapiauth2initparams
30
+ @immutable
31
+ class SignInInitParameters {
32
+ /// The parameters to use when initializing the sign in process.
33
+ const SignInInitParameters ({
34
+ this .scopes = const < String > [],
35
+ this .signInOption = SignInOption .standard,
36
+ this .hostedDomain,
37
+ this .clientId,
38
+ this .forceCodeForRefreshToken = false ,
39
+ });
40
+
41
+ /// The list of OAuth scope codes to request when signing in.
42
+ final List <String > scopes;
43
+
44
+ /// The user experience to use when signing in. [SignInOption.games] is
45
+ /// only supported on Android.
46
+ final SignInOption signInOption;
47
+
48
+ /// Restricts sign in to accounts of the user in the specified domain.
49
+ /// By default, the list of accounts will not be restricted.
50
+ final String ? hostedDomain;
51
+
52
+ /// The client ID to use when signing in.
53
+ final String ? clientId;
54
+
55
+ /// If true, ensures the authorization code can be exchanged for an access
56
+ /// token.
57
+ ///
58
+ /// This is only used on Android.
59
+ final bool forceCodeForRefreshToken;
60
+ }
61
+
25
62
/// Holds information about the signed in user.
26
63
class GoogleSignInUserData {
27
64
/// Uses the given data to construct an instance.
0 commit comments