Commit 3d84cfc4 by Chokmongkhon Jansanom

feat: active liveness.

parent 56daecf1
import 'package:flutter/material.dart';
import 'package:myhr_facescan/active_liveness/index.dart';
import 'package:myhr_facescan_example/env.dart';
class ActiveLivenessPage extends StatelessWidget {
const ActiveLivenessPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Active Liveness'),
),
body: SafeArea(
child: ActiveLivenessDetector(
licenseKey: Env.luxandLicenseKey,
onFinish: (p0) {},
)),
);
}
}
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:myhr_facescan/enroll/index.dart';
import 'package:myhr_facescan_example/enroll/liveness.dart';
import 'package:myhr_facescan_example/env.dart';
class EnrollPage extends StatelessWidget {
const EnrollPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Enroll Face'),
),
body: SafeArea(
child: EnrollFace(
licenseKey: Env.luxandLicenseKey,
onFinish: (p0) {
Get.off(const LivenessPage());
},
)),
);
}
}
import 'package:flutter/material.dart';
import 'package:myhr_facescan_example/env.dart';
import 'package:myhr_facescan/active_liveness/index.dart';
class LivenessPage extends StatelessWidget {
const LivenessPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Liveness Detection'),
),
body: SafeArea(
child: ActiveLivenessDetector(
licenseKey: Env.luxandLicenseKey,
onFinish: (p0) {},
)),
);
}
}
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:myhr_facescan/enroll/index.dart';
import 'package:myhr_facescan_example/env.dart';
import 'package:myhr_facescan_example/active_liveness/index.dart';
import 'package:myhr_facescan_example/enroll/index.dart';
void main() {
runApp(const MyApp());
......@@ -23,34 +23,20 @@ class HomePage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Test'),
title: const Text('Luxand x Flutter'),
),
body: Column(
children: [
ElevatedButton(
onPressed: () => Get.to(const EnrollPage()),
child: const Text('Enroll'))
],
),
);
}
}
class EnrollPage extends StatelessWidget {
const EnrollPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Enroll Face'),
),
body: const SafeArea(
child: SingleChildScrollView(
child: EnrollFace(
licenseKey: Env.luxandLicenseKey,
body: Center(
child: Column(
children: [
ElevatedButton(
onPressed: () => Get.to(const EnrollPage()),
child: const Text('Enroll Face')),
ElevatedButton(
onPressed: () => Get.to(const ActiveLivenessPage()),
child: const Text('Active Liveness')),
],
),
)),
),
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment