Requirements
Flutter 3.24 or later (Dart 3.5), Android 7.0 (API 24) or later, iOS 14.3 or later.
Install
Take the flutter folder from the SDK archive and add it as a path dependency:
dependencies:
veriffy_flutter:
path: ../veriffy-sdk/flutterCamera access
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<key>NSCameraUsageDescription</key>
<string>We use the camera to photograph your ID document and take a selfie for identity verification.</string>
The permission_handler version
permission_handler 13.x needs compileSdk 37. If your app is on a lower version, pin permission_handler: ^12.0.0 in your pubspec.yaml.
Usage
import 'package:veriffy_flutter/veriffy_flutter.dart';
Future<void> verify(BuildContext context) async {
final url = await myBackend.createVerificationSession(); // your server: POST /v1/sessions
if (!context.mounted) return;
final result = await Veriffy.start(
context,
url,
onEvent: (event) {
if (event is VeriffyStepEvent) analytics.log('kyc_step', event.step);
},
);
switch (result) {
case VeriffyCompleted(:final status):
showPending(status);
case VeriffyCancelled():
showRetry();
case VeriffyFailed(:final error):
showError(error.code);
}
}Veriffy.start opens the verification full screen and returns the result when it closes.