kyc_widget_falconlite
Universal KYC verification widget for Flutter applications with WebView integration.
Features
- ✅ Tier 1 KYC (BVN + Selfie + Document)
- ✅ Tier 2 KYC (Enhanced verification)
- ✅ Cross-platform liveness detection
- ✅ Legacy user support with skip functionality
- ✅ Native Flutter integration via WebView
- ✅ Camera access for selfie capture
- ✅ Responsive design
Installation
Add to your pubspec.yaml:
dependencies:
kyc_widget_falconlite: ^1.2.0
Then run:
flutter pub get
Platform Setup
Android
Add to android/app/src/main/AndroidManifest.xml:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
iOS
Add to ios/Runner/Info.plist:
<key>NSCameraUsageDescription</key>
<string>We need camera access for KYC verification</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need microphone access for video verification</string>
Usage
Basic Example
import 'package:flutter/material.dart';
import 'package:kyc_widget_falconlite/kyc_widget_falconlite.dart';
class KYCScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('KYC Verification')),
body: KYCWidget(
config: KYCConfig(
tier: 'tier_1',
accessToken: 'your-access-token',
apiBaseUrl: 'https://api.yourapp.com',
theme: 'light',
),
onSuccess: (result) {
print('KYC Success: ${result.data}');
Navigator.pop(context);
},
onError: (error) {
print('KYC Error: $error');
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text('KYC failed: $error')),
);
},
onProgress: (step, progress) {
print('KYC Progress: $step - $progress%');
},
),
);
}
}
Tier 2 KYC
KYCWidget(
config: KYCConfig(
tier: 'tier_2',
accessToken: 'your-access-token',
apiBaseUrl: 'https://api.yourapp.com',
),
onSuccess: (result) {
// Handle Tier 2 completion
},
)
API Reference
KYCConfig
| Property | Type | Required | Description |
|---|---|---|---|
tier |
String |
Yes | KYC tier level ('tier_1' or 'tier_2') |
accessToken |
String |
Yes | User authentication token |
apiBaseUrl |
String |
Yes | Base URL for API endpoints |
theme |
String |
No | Widget theme ('light' or 'dark') |
user |
Map<String, dynamic> |
No | User information object |
KYCWidget
| Property | Type | Required | Description |
|---|---|---|---|
config |
KYCConfig |
Yes | Widget configuration |
onSuccess |
Function(KYCResult)? |
No | Success callback |
onError |
Function(String)? |
No | Error callback |
onProgress |
Function(String, double)? |
No | Progress callback |
KYCResult
| Property | Type | Description |
|---|---|---|
success |
bool |
Whether verification succeeded |
data |
Map<String, dynamic>? |
Verification result data |
error |
String? |
Error message if failed |
Features
Cross-Platform Liveness Detection
- Desktop: Live camera with real-time face detection
- iOS Safari: Live camera with face-api.js
- iOS WebView: File input with post-capture analysis
- Android: Live camera with face detection
Legacy User Support
- Skip functionality for users with existing BVN/NUBAN
- Compliance banner reminders
- 7-day skip persistence
Responsive Design
- Mobile-first design
- Desktop support with centered layout
- Adaptive UI components
Example App
See the example/ directory for a complete Flutter app demonstrating all features.
Troubleshooting
Camera not working on iOS
Ensure you've added camera permissions to Info.plist.
WebView not loading
Check internet connectivity and API base URL.
JavaScript errors
Ensure JavaScriptMode.unrestricted is enabled.
License
MIT