import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:myhr_facescan/active_liveness/index.dart';
import 'package:myhr_facescan_example/env.dart';
import 'package:myhr_facescan_example/main.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: ActiveLivenessVerifier(
        licenseKey: Env.luxandLicenseKey,
        onFinish: (success, template) {
          if (success) {
            Get.snackbar('Success', 'You\'re human');
          } else {
            Get.snackbar('Fail', 'You\'re not human.');
          }

          Get.offAll(const HomePage());
        },
      )),
    );
  }
}