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
| Parameter | Type | Required | Description |
|---|---|---|---|
enabledProviders | List<SsoProvider> | yes | Which auth methods to show |
enabledWallets | List<SsoWalletType>? | no | Which wallets to show (requires SsoProvider.wallet) |
authToken | String? | no | Access token for API calls |
theme | SsoResolvedTheme? | no | Override the SDK-level theme for this screen |
locale | String? | no | Override the language for this screen |
onSuccess | Function(SsoTokens)? | no | Called when auth completes successfully |
onCancel | VoidCallback? | no | Called when user dismisses the auth flow |
onError | Function(SsoError)? | no | Called on critical errors |
termsUrl | String? | no | Terms of Service URL |
privacyUrl | String? | no | Privacy Policy URL |
Providers
| Provider | Enum value | Description |
|---|---|---|
| Email / Password | SsoProvider.emailPassword | Login + registration with email/phone, username, password |
SsoProvider.google | Google Sign-In | |
| Apple | SsoProvider.apple | Apple Sign-In |
| X (Twitter) | SsoProvider.x | X OAuth 2.0 |
| Telegram | SsoProvider.telegram | Telegram OAuth |
| Wallet | SsoProvider.wallet | ETH / SOL / TON wallets |
Wallet types
| Wallet | Enum value | Chain |
|---|---|---|
| MetaMask | SsoWalletType.metaMask | ETH |
| Trust Wallet | SsoWalletType.trustWallet | ETH |
| WalletConnect | SsoWalletType.walletConnect | ETH (universal) |
| Phantom | SsoWalletType.phantom | SOL |
| Tonkeeper | SsoWalletType.tonKeeper | TON |
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
| Parameter | Type | Default | Description |
|---|---|---|---|
context | BuildContext | — (required) | The build context used to show the bottom sheet |
heightFactor | double | 0.9 | Fraction of screen height (0.0–1.0) |
topRadius | double | 20.0 | Border radius of top corners in logical pixels |
isDismissible | bool | true | Whether tapping the scrim dismisses the sheet |
enableDrag | bool | true | Whether 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.