OneTap.withOAuths constructor

OneTap.withOAuths({
  1. required Key key,
  2. required dynamic onAuth(
    1. OneTapOAuth? oAuth,
    2. AuthData accessToken
    ),
  3. dynamic onAuthCode(
    1. AuthCodeData data,
    2. bool isCompletion
    ) = _defaultOnAuthCode,
  4. dynamic onError(
    1. OneTapOAuth? oAuth,
    2. AuthError error
    ) = _defaultOnError,
  5. Set<OneTapOAuth> alternativeOAuths = const {},
  6. OneTapWithOAuthsStyle style = const OneTapWithOAuthsStyle(),
  7. bool fastAuthEnabled = true,
  8. bool signInToAnotherAccountButtonEnabled = true,
  9. UIAuthParams authParams = const UIAuthParams._(),
  10. OneTapTitleScenario scenario = OneTapTitleScenario.signIn,
})

Constructs a OneTap with alternative OAuths. The styling in this case is limited.

There are some parameters, that you can provide. key can be used to retrieve State of the widget. onAuth will be called after successful auth if you passed PublicFlowData to authParams. onAuthCode will be called if you passed ConfidentialFlowData to authParams. onError will be called if any error was encountered during auth. style allows to style the widget. fastAuthEnabled allows to disable user fetching on Android. signInToAnotherAccountButtonEnabled allows to hide a button for changing account. authParams specify auth flow and scopes. Read more about them in UIAuthParamsBuilder. scenario allows to change text on the button.

Implementation

OneTap.withOAuths({
  required Key key,
  required Function(OneTapOAuth? oAuth, AuthData accessToken) onAuth,
  Function(AuthCodeData data, bool isCompletion) onAuthCode =
      _defaultOnAuthCode,
  Function(OneTapOAuth? oAuth, AuthError error) onError = _defaultOnError,
  Set<OneTapOAuth> alternativeOAuths = const {},
  OneTapWithOAuthsStyle style = const OneTapWithOAuthsStyle(),
  bool fastAuthEnabled = true,
  bool signInToAnotherAccountButtonEnabled = true,
  UIAuthParams authParams = const UIAuthParams._(),
  OneTapTitleScenario scenario = OneTapTitleScenario.signIn,
})  : _onAuth = onAuth,
      _onAuthCode = onAuthCode,
      _onError = onError,
      _alternativeOAuths = alternativeOAuths,
      _style = style.toOneTapStyle(),
      _fastAuthEnabled = fastAuthEnabled,
      _signInToAnotherAccountButtonEnabled =
          signInToAnotherAccountButtonEnabled,
      _authParams = authParams,
      _scenario = scenario,
      super(key: key);