liveness_cam_pro 0.0.4 copy "liveness_cam_pro: ^0.0.4" to clipboard
liveness_cam_pro: ^0.0.4 copied to clipboard

Liveness camera for detecting fraud or detecting real person selfie

example/lib/main.dart

import 'dart:io';
import 'package:flutter/material.dart';
import 'package:liveness_cam_pro/liveness_cam.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 _livenessCam = LivenessCam();

  File? result;

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Liveness Cam'),
        ),
        body: Center(
          child: Column(
            children: [
              result != null ? Image.file(result!) : Container(),
              const SizedBox(
                height: 20,
              ),
              Builder(builder: (context) {
                return ElevatedButton(
                    onPressed: () {
                      _livenessCam.start(context).then((value) {
                        if (value != null) {
                          setState(() {
                            result = value;
                          });
                        }
                      });
                    },
                    child: const Text(
                      "Start",
                      style: TextStyle(fontSize: 19),
                    ));
              })
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
49
downloads

Publisher

unverified uploader

Weekly Downloads

Liveness camera for detecting fraud or detecting real person selfie

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

camera, flutter, google_mlkit_face_detection

More

Packages that depend on liveness_cam_pro