OneTap.withOAuths constructor
OneTap.withOAuths({
- required Key key,
- required dynamic onAuth(
- OneTapOAuth? oAuth,
- AuthData accessToken
- dynamic onAuthCode(
- AuthCodeData data,
- bool isCompletion
- dynamic onError(
- OneTapOAuth? oAuth,
- AuthError error
- Set<
OneTapOAuth> alternativeOAuths = const {}, - OneTapWithOAuthsStyle style = const OneTapWithOAuthsStyle(),
- bool fastAuthEnabled = true,
- bool signInToAnotherAccountButtonEnabled = true,
- UIAuthParams authParams = const UIAuthParams._(),
- 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);