ekyc_vn_flutter_sdk 1.0.0
ekyc_vn_flutter_sdk: ^1.0.0 copied to clipboard
On-device eKYC capture for Flutter: guided Vietnamese ID card and passport capture with card liveness, and a face liveness flow (look straight, left, right). Ready-made screens for Android and iOS.
example/lib/main.dart
// main.dart
import 'package:example/validation/card_font_valiation_screen.dart';
import 'package:flutter/material.dart';
import 'validation/card_back_valiation_screen.dart';
import 'validation/face_validation_screen.dart';
import 'validation/passport_valiation_screen.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
routes: {
'/': (context) => const HomePage(), // context này tạo ra HomePage
'/face_liveness': (context) => const FaceValidationScreen(),
'/card_font_liveness': (context) => const CardFontValidationScreen(),
'/card_back_liveness': (context) => const CardBackValidationScreen(),
'/passport_liveness': (context) => const PassportValidationScreen(),
},
initialRoute: '/', // Route bắt đầu
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SizedBox(
width: MediaQuery.of(context).size.width,
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () {
Navigator.of(context).pushNamed('/card_font_liveness');
},
child: const Text('Go to Font card Validation Screen'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.of(context).pushNamed('/card_back_liveness');
},
child: const Text('Go to Back card Validation Screen'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.of(context).pushNamed('/passport_liveness');
},
child: const Text('Go to Passport Validation Screen'),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
Navigator.of(context).pushNamed('/face_liveness');
},
child: const Text('Go to Face Validation Screen'),
),
],
),
),
);
}
}