SignInGoogle constructor

SignInGoogle({
  1. required dynamic clientId,
  2. dynamic scopes = const ['email'],
  3. dynamic debugLog = false,
})
  • clientId
    • use Google OAuth Chrome Application Client Id standalone app
    • use Google OAuth Web Application Client Id for webpage
    • cannot be empty
  • scopes : scopes for OAuth signin
    • Default ['email'] for Google api
  • debugLog : force print of log message. Default false

Implementation

SignInGoogle({
  required clientId,
  scopes = const ['email'],
  debugLog = false,
})  : _api = GoogleSignIn(clientId: clientId, scopes: scopes),
      super(
        clientId: clientId,
        debugLog: debugLog,
        scopes: scopes,
      ) {
  String debugPrefix = '$runtimeType.SignInGoogle()';
  assert(clientId.isNotEmpty, '$debugPrefix:clientId cannot be empty');
  _api.onCurrentUserChanged.listen((account) {
    _apiOnUserChange(account);
  });
  lazy.log('$debugPrefix:GoogleSignIn().listen():done', forced: debugLog);
}