sdk_ekyc_flutter 1.0.0
sdk_ekyc_flutter: ^1.0.0 copied to clipboard
Identity verification screens for Flutter that run on the phone: scan the front and back of a Vietnamese citizen ID or a passport photo page with a document liveness check, then a face liveness check [...]
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:sdk_ekyc_flutter/sdk_ekyc_flutter.dart';
import 'screens/document_screen.dart';
import 'screens/face_screen.dart';
void main() => runApp(const ExampleApp());
class ExampleApp extends StatelessWidget {
const ExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'sdk_ekyc_flutter',
theme: ThemeData(colorSchemeSeed: Colors.teal, useMaterial3: true),
home: const HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
static const _documents = <(DocumentPage, String)>[
(DocumentPage.citizenIdFront, 'Căn cước — mặt trước'),
(DocumentPage.citizenIdBack, 'Căn cước — mặt sau'),
(DocumentPage.passport, 'Hộ chiếu'),
];
void _open(BuildContext context, Widget screen) {
Navigator.of(context).push(MaterialPageRoute<String>(builder: (_) => screen));
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('sdk_ekyc_flutter')),
body: ListView(
padding: const EdgeInsets.all(16),
children: [
for (final (page, title) in _documents)
ListTile(
leading: const Icon(Icons.badge_outlined),
title: Text(title),
onTap: () =>
_open(context, DocumentScreen(page: page, title: title)),
),
ListTile(
leading: const Icon(Icons.face_retouching_natural),
title: const Text('Kiểm tra khuôn mặt'),
onTap: () => _open(context, const FaceScreen()),
),
],
),
);
}
}