π¦ Installation
In your pubspec.yaml, add:
flutter pub add verif_id
π Permissions & Platform Setup
This package requires Camera, Microphone, and Storage access.
β Android
Edit android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-feature android:name="android.hardware.camera" android:required="true" />
<application ...>
</application>
π If targeting Android 13+, runtime permissions are handled automatically via permission_handler.
π iOS
1. Edit ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>This app requires camera access for identity verification.</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires microphone access for video recording.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app may save temporary files during verification.</string>
2. β οΈ CRITICAL: Configure ios/Podfile
Add the permission_handler configuration to your ios/Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
'$(inherited)',
## dart: PermissionGroup.camera
'PERMISSION_CAMERA=1',
## dart: PermissionGroup.microphone
'PERMISSION_MICROPHONE=1',
## dart: PermissionGroup.photos
'PERMISSION_PHOTOS=1',
]
end
end
end
3. Clean and rebuild after Podfile changes:
cd ios && rm -rf Pods Podfile.lock && cd ..
flutter clean
flutter pub get
flutter run
π Web
- Works on modern browsers with camera + mic support.
- Must be served over HTTPS.
- User will be prompted for permissions automatically.
π Usage
Basic Example
import 'package:flutter/material.dart';
import 'package:verif_id/verif_id.dart';
class KycPage extends StatelessWidget {
const KycPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("KYC Verification")),
body: VerifId(
sessionId: "user-session-001",
onSubmit: (data) async {
// Send KYC data to your server
print("Submitted data: $data");
},
),
);
}
}
βοΈ Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
sessionId |
String |
null |
Unique identifier for the verification session (useful for backend tracking). |
onSubmit |
Future<void> Function(KYCData) |
required | Callback fired once the user submits the verification flow. |
enableTts |
bool |
true |
Whether to enable French female voice TTS guidance. |
locale |
Locale |
Locale('fr', 'FR') |
Locale for TTS (currently optimized for French). |
πΌ Steps in the Flow
- Selfie Step β User takes a selfie.
- Video Step β User records a 5s video for liveness detection.
- ID Front Step β Capture the front of the ID card.
- ID Back Step β Capture the back of the ID card.
- Review & Submit β User reviews captures, can re-verify, then submits.
π Flow Diagram
flowchart TD
A[Start Verification] --> B[Take Selfie]
B --> C[Record 5s Selfie Video]
C --> D[Capture ID Front]
D --> E[Capture ID Back]
E --> F[Review All Captures]
F -->|Submit| G[Send Data to Backend]
F -->|Re-verify| B
G --> H[Done β
]
π Sequence Diagram
sequenceDiagram
participant User
participant App
participant TTS
participant Backend
User->>App: Start Verification
App->>TTS: "Prenez un selfie"
User->>App: Capture Selfie
App->>TTS: "Enregistrez une vidΓ©o de 5 secondes"
User->>App: Record Video
App->>TTS: "Scannez la face avant de votre carte"
User->>App: Capture ID Front
App->>TTS: "Scannez la face arrière de votre carte"
User->>App: Capture ID Back
App->>User: Show Review Screen
User->>App: Submit
App->>Backend: Upload KYC Data
Backend-->>App: Verification Complete
App-->>User: Done β
π‘ Use Cases
- Fintech apps β Customer onboarding (banking, wallets, payments)
- Marketplace apps β Seller verification
- Rental platforms β Tenant / vehicle renter verification
- Health services β Patient ID confirmation
π Roadmap
OCR integration for auto-extracting ID dataMulti-language TTS support (English, Spanish, etc.)Optional selfie-with-ID captureServer API helpers
βοΈ License
MIT Β© 2025 Freddy dro