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