Skip to main content

Auth Screen

SsoSdk.authScreen() returns a widget with the full authentication flow: login, registration, verification, backup, and success screens — all with internal routing.

Usage

Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => SsoSdk.authScreen(
enabledProviders: [
SsoProvider.emailPassword,
SsoProvider.google,
SsoProvider.apple,
SsoProvider.telegram,
SsoProvider.x,
SsoProvider.wallet,
],
enabledWallets: [
SsoWalletType.metaMask,
SsoWalletType.trustWallet,
SsoWalletType.walletConnect,
SsoWalletType.phantom,
SsoWalletType.tonKeeper,
],
authToken: authToken,
theme: SsoResolvedTheme.chatoshiDark(),
locale: 'en',
onSuccess: (tokens) {
Navigator.of(context).pop();
},
onError: (error) {
debugPrint('Error: code=${error.code} message=${error.message}');
},
onCancel: () => Navigator.of(context).pop(),
termsUrl: 'https://example.com/terms',
privacyUrl: 'https://example.com/privacy',
),
),
);

Parameters

ParameterTypeRequiredDescription
enabledProvidersList<SsoProvider>yesWhich auth methods to show
enabledWalletsList<SsoWalletType>?noWhich wallets to show (requires SsoProvider.wallet)
authTokenString?noAccess token for API calls
themeSsoResolvedTheme?noOverride the SDK-level theme for this screen
localeString?noOverride the language for this screen
onSuccessFunction(SsoTokens)?noCalled when auth completes successfully
onCancelVoidCallback?noCalled when user dismisses the auth flow
onErrorFunction(SsoError)?noCalled on critical errors
termsUrlString?noTerms of Service URL
privacyUrlString?noPrivacy Policy URL

Providers

ProviderEnum valueDescription
Email / PasswordSsoProvider.emailPasswordLogin + registration with email/phone, username, password
GoogleSsoProvider.googleGoogle Sign-In
AppleSsoProvider.appleApple Sign-In
X (Twitter)SsoProvider.xX OAuth 2.0
TelegramSsoProvider.telegramTelegram OAuth
WalletSsoProvider.walletETH / SOL / TON wallets

Wallet types

WalletEnum valueChain
MetaMaskSsoWalletType.metaMaskETH
Trust WalletSsoWalletType.trustWalletETH
WalletConnectSsoWalletType.walletConnectETH (universal)
PhantomSsoWalletType.phantomSOL
TonkeeperSsoWalletType.tonKeeperTON

Bottom Sheet Mode

As an alternative to a full-page push, you can show the auth flow as a modal bottom sheet that slides up from the bottom of the screen:

await SsoSdk.showAuthBottomSheet(
context: context,
enabledProviders: [
SsoProvider.emailPassword,
SsoProvider.google,
SsoProvider.apple,
],
authToken: authToken,
theme: SsoResolvedTheme.chatoshiDark(),
locale: 'en',
onSuccess: (tokens) {
// Bottom sheet auto-dismisses on success
},
onCancel: () {
// Called when user swipes down or taps cancel
},
onError: (error) {
debugPrint('Error: ${error.message}');
},
termsUrl: 'https://example.com/terms',
privacyUrl: 'https://example.com/privacy',
);

The bottom sheet occupies 90% of screen height by default, has rounded top corners with a drag handle, and can be dismissed by swiping down.

Additional parameters

ParameterTypeDefaultDescription
contextBuildContext— (required)The build context used to show the bottom sheet
heightFactordouble0.9Fraction of screen height (0.0–1.0)
topRadiusdouble20.0Border radius of top corners in logical pixels
isDismissiblebooltrueWhether tapping the scrim dismisses the sheet
enableDragbooltrueWhether the sheet can be dismissed by swiping down

All other parameters (enabledProviders, enabledWallets, authToken, theme, locale, onSuccess, onCancel, onError, termsUrl, privacyUrl) work identically to authScreen().

Internal flow

The auth screen manages its own Navigator. The user flow is:

OAuth landing → Login or Sign Up

Email/Phone Verification

Backup (email or phone)

Success → onSuccess callback

You don't need to handle routing — the SDK manages it internally.