You can visit the official Stripe Identity Documentation for a complete overview of how Stripe Identity works.
This package helps you integrate Stripe Identity seamlessly into your Flutter app.
- ✅ Easy integration with Stripe Identity Verification
- 📱 Support for both Android and iOS platforms
- 🧩 Customizable brand logo display
- 🛡️ Secure verification handled by Stripe SDK
- 🔍 Simple error handling and type-safe results
Add to your pubspec.yaml:
dependencies:
stripe_identity_plugin: ^1.0.4Inside android/app/src/main/AndroidManifest.xml, add the following:
<uses-permission android:name="android.permission.CAMERA" />
<application>
<activity
android:name="com.stripe.android.identity.IdentityActivity"
android:exported="false"
android:theme="@style/StripeIdentityTheme" />
</application>In android/app/src/main/res/values/styles.xml:
<style name="StripeIdentityTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">#000000</item>
<item name="colorPrimaryVariant">#000000</item>
<item name="colorOnPrimary">#FFFFFF</item>
<item name="android:statusBarColor">#000000</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:windowBackground">@android:color/white</item>
</style>package com.example.your_app_name
import io.flutter.embedding.android.FlutterFragmentActivity
class MainActivity : FlutterFragmentActivity()
FlutterFragmentActivityis required for fragment-based Stripe Identity flows.
Edit your ios/Runner/Info.plist and add:
<key>NSCameraUsageDescription</key>
<string>This app requires camera access for identity verification.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to your photo library to upload documents.</string>To customize button colors, links, and default blue UI elements, add this in AppDelegate.swift:
import UIKit
import Flutter
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// Set global tint color to black
UIView.appearance().tintColor = .black
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}This will change button and icon tint colors from default system blue to black throughout Stripe's native UI.
After getting the session ID and ephemeral key from your server:
final stripeIdentity = StripeIdentityPlugin();
final (status, message) = await stripeIdentity.startVerification(
id: 'verification_session_id_from_server',
key: 'ephemeral_key_secret_from_server',
brandLogoUrl: 'https://your-domain.com/logo.png', // Optional
);
switch (status) {
case VerificationResult.completed:
print('✅ Verification completed successfully');
break;
case VerificationResult.canceled:
print('⚠️ User canceled verification');
break;
case VerificationResult.failed:
print('❌ Verification failed: $message');
break;
case VerificationResult.unknown:
print('❓ Unknown error: $message');
break;
}📽️ View Demo – Success Flow If your API key and session ID are correct, the verification will start as expected.
📽️ View Demo – Error Flow If you use invalid credentials, you’ll see how the plugin handles the error gracefully.
- Never expose
STRIPE_SECRETin your Flutter app. - Always call Stripe from a backend service.
- Protect your endpoints using authentication and HTTPS.