vouchmark_widget is a Dart package that renders the Vouchmark verification flow inside a native WebView (webview_flutter), bridging events back to Dart through a JavaScript channel.
Installation
Add the package with the Flutter CLI:vouchmark_widget to your pubspec.yaml (current version 1.0.0).
Platform setup
Android — setminSdkVersion 21 in android/app/build.gradle.
iOS — requires iOS 13+. Add camera permissions to ios/Runner/Info.plist:
Quick start
Configuration
VouchmarkWidget parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
widgetId | String | Yes | Widget ID from the dashboard. Must match the widget’s environment. |
publicKey | String | Yes | Publishable key: test_pk_… (sandbox) or live_pk_… (live). |
environment | VouchmarkEnvironment | Yes | .sandbox with test_pk_…, .live with live_pk_…. See Environments. |
applicant | VouchmarkApplicant? | No | Pre-fill applicant details. |
referenceId | String? | No | Your internal reference. |
sessionToken | String? | No | Signed server token for secure mode. |
locale | String? | No | Language code. Default "en". |
onSuccess | void Function(VouchmarkResult) | No | Called on approval. |
onAbandon | VoidCallback? | No | Called when user closes. |
onError | void Function(VouchmarkError)? | No | Called on error. |
onStepCompleted | void Function(VouchmarkStep)? | No | Called after each module. |
Modal presentation
CallshowVouchmarkModal to push the widget as a full-screen dialog route. It returns a Future<VouchmarkResult?> that resolves with the result when verification succeeds, or null if the user dismisses it:
Models
Signed sessions
Generate the session token on your backend and pass it to the widget:Platform support
| Platform | Minimum version |
|---|---|
| Android | API 21 (5.0)+ |
| iOS | 13.0+ |
