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

outdated

Liveness camera for detecting fraud.

example/lib/main.dart

import 'dart:io';
import 'dart:math';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:liveness_cam/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: InkWell(
              onTap: () {
                _livenessCam.start();
              },
              child: Column(
                children: [
                  result != null ? Image.file(result!) : Container(),
                  const SizedBox(
                    height: 20,
                  ),
                  ElevatedButton(
                      onPressed: () {
                        _livenessCam.start().then((value) {
                          if (value != null) {
                            setState(() {
                              result = value;
                            });
                          }
                        });
                      },
                      child: const Text(
                        "Start",
                        style: TextStyle(fontSize: 19),
                      ))
                ],
              )),
        ),
      ),
    );
  }
}
8
likes
0
pub points
59%
popularity

Publisher

verified publisherkakzaki.dev

Liveness camera for detecting fraud.

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on liveness_cam