Prerequisites
Prerequisites
Before you begin, make sure you have:
- Flutter 3.0+ - The SDK requires Flutter 3.0 or later
- Dart 3.0+ - Modern Dart features are used throughout
- iOS 13.0+ / Android 6.0+ - For mobile platform support
- Dynamic Account - Set up your project and get an environment ID from Dynamic Dashboard
Platform support: The Flutter SDK currently supports iOS and Android only. Web and desktop platforms are not supported at this time.
Install the SDK
Or manually add to yourpubspec.yaml:
Initialize the SDK
Configuration Options
| Property | Description | Required |
|---|---|---|
environmentId | Your Dynamic environment ID from the dashboard | Yes |
appLogoUrl | URL to your app’s logo (shown in auth UI) | Yes |
appName | Your app’s display name | Yes |
redirectUrl | Deep link URL scheme for social auth callbacks | No |
Access the SDK
After initialization, access the SDK singleton anywhere in your app:Basic Usage
Using Built-in Authentication UI
The easiest way to add authentication is using the built-in UI:Listening for Authentication State
Use StreamBuilder to react to authentication changes:Complete Example with Wallets
Enable Features in Dashboard
Before you can use authentication and wallet features, enable them in your Dynamic dashboard:- Go to your Dynamic Dashboard
- Select your project
- Go to Authentication and enable the methods you want to use:
- Email OTP
- SMS OTP
- Social providers (Google, Apple, Discord, Farcaster, GitHub, Twitter, Facebook)
- Go to Wallets and enable embedded wallets
- Go to Chains and enable the networks you want to support (EVM and/or Solana)
Troubleshooting
Common Issues
-
Could not find package ‘dynamic_sdk’
- Make sure you’ve added the package to your
pubspec.yaml - Run
flutter pub get - Try
flutter clean && flutter pub get
- Make sure you’ve added the package to your
-
SDK not initialized
- Ensure
DynamicSDK.init()is called inmain()beforerunApp() - Don’t access
DynamicSDK.instancebefore initialization
- Ensure
-
Authentication callbacks not working
- Verify your URL scheme is configured in your iOS Info.plist
- For Android, configure the deeplink scheme in AndroidManifest.xml
- Ensure the
redirectUrlmatches your URL scheme - Whitelist your deep link URL in the Dynamic dashboard under Security → Whitelist Mobile Deeplink
- See Social Authentication for detailed setup
-
Wallets not appearing after login
- Wallets are created asynchronously after authentication
- Use
DynamicSDK.instance.wallets.userWalletsChangesstream to listen for wallet updates - Check that embedded wallets are enabled in your dashboard
- See Wallet Creation for details
-
Session state not updating
- Make sure you’re using
StreamBuilderto observe state changes - Verify that
DynamicSDK.instance.dynamicWidgetis included in your widget tree (required) - Check that streams are being properly subscribed to
- Make sure you’re using
-
UI not showing
- The
DynamicSDK.instance.dynamicWidgetmust be in your widget tree (typically in a Stack) - This widget provides the overlay for authentication and profile UI
- Position it above your main content in a Stack
- The
Next Steps
Great! Your SDK is now configured and ready to use. Here’s what you can do next:- Introduction - Learn about all SDK features and architecture
- Client Setup - Detailed SDK configuration and modules
- Authentication Guide - Implement email, SMS, and OTP authentication
- Social Authentication - Add social login options
- Session Management - Manage authenticated sessions with Streams
- Wallet Operations - Work with balances and sign messages
- Networks - Configure blockchain networks
📱 Complete Example App: For a fully functional Flutter app demonstrating all SDK
features, check out our Flutter SDK Example App. It
includes authentication flows (email/SMS OTP, social login), wallet management, EVM/Solana transactions,
and more.
Additional Resources
- Go Router Integration - Integrate with go_router for navigation
- Web3Dart Integration - Deep dive into EVM blockchain interactions
- Solana Integration - Deep dive into Solana blockchain interactions
- SDK Reference - Complete API documentation