facedapter_idv 0.1.5 facedapter_idv: ^0.1.5 copied to clipboard
FacedapterIDV SDK provides fast, secured and accurate onboarding data. Digitize identities with an automated approach that screens, classifies ad extracts ID document.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:facedapter_idv/facedapter_idv.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({Key? key}) : super(key: key);
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
final FacedapterIdvPlugin = FacedapterIdv();
@override
void initState() {
super.initState();
initialize();
}
Future<void> initialize() async {
await FacedapterIdvPlugin.initialize("YOUR_API_KEY", 2);
}
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> startOnboarding() async {
Map<dynamic, dynamic> result = {};
// Platform messages may fail, so we use a try/catch PlatformException.
// We also handle the message potentially returning null.
try {
result = await FacedapterIdvPlugin.startOnboarding() ?? {};
print(result);
} on PlatformException {
// result = {};
}
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Facedapter IDV Onboarding'),
),
body: Center(
child: TextButton(
style: TextButton.styleFrom(
textStyle: const TextStyle(fontSize: 20),
),
onPressed: startOnboarding,
child: const Text('Launch SDK'),
),
)
),
);
}
}