OneTap constructor

const OneTap({
  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. OneTapStyle style = const OneTapStyle(),
  6. bool fastAuthEnabled = true,
  7. bool signInToAnotherAccountButtonEnabled = true,
  8. UIAuthParams authParams = const UIAuthParams._(),
  9. OneTapTitleScenario scenario = OneTapTitleScenario.signIn,
})

Constructs a OneTap without alternative OAuths.

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

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