verification_sdk 1.2.1
verification_sdk: ^1.2.1 copied to clipboard
Flutter SDK for multi-stage identity verification with camera, webview and KYC flows for mobile and web apps.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:verification_sdk/verification_sdk.dart';
import 'src/simple_callbacks.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize the SDK once before first use.
// Replace placeholders with real values from your backend.
await VerificationSDK.initialize(
clientId: 'YOUR_CLIENT_ID',
sessionToken: 'YOUR_SESSION_TOKEN',
environment: Environment.sandbox,
userData: {
'brandLogoUrl': 'https://example.com/logo.png',
'primaryColor': '#1E88E5', // optional: int (0xFF...) or hex string
},
);
runApp(const ExampleApp());
}
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Verification SDK Example',
home: HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
// Use the helper from src/simple_callbacks.dart
final callbacks = makeSimpleCallbacks();
return Scaffold(
appBar: AppBar(title: const Text('Verification SDK Example')),
body: Center(
child: ElevatedButton(
onPressed: () {
VerificationSDK.startVerification(
context,
callbacks: callbacks,
);
},
child: const Text('Start Verification'),
),
),
);
}
}