flutter_liveness_detection_randomized_plugin 1.0.2 copy "flutter_liveness_detection_randomized_plugin: ^1.0.2" to clipboard
flutter_liveness_detection_randomized_plugin: ^1.0.2 copied to clipboard

A Flutter plugin for liveness detection with randomized challenge response method

example/lib/main.dart

import 'package:flutter_liveness_detection_randomized_plugin/index.dart';

void main() {
  runApp(const MaterialApp(
    debugShowCheckedModeBanner: false,
    home: HomeView(),
  ));
}

class HomeView extends StatefulWidget {
  const HomeView({super.key});

  @override
  State<HomeView> createState() => _HomeViewState();
}

class _HomeViewState extends State<HomeView> {
  List<String?> capturedImages = [];
  String? imgPath;

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
          child: ListView(
        shrinkWrap: true,
        padding: const EdgeInsets.all(12),
        children: [
          if (imgPath != null) ...[
            const Text(
              'Result Liveness Detection',
              textAlign: TextAlign.center,
            ),
            const SizedBox(
              height: 12,
            ),
            Align(
              child: SizedBox(
                height: 100,
                width: 100,
                child: ClipRRect(
                  borderRadius: BorderRadius.circular(20),
                  child: Image.file(
                    File(imgPath!),
                    fit: BoxFit.cover,
                  ),
                ),
              ),
            ),
            const SizedBox(
              height: 12,
            ),
          ],
          ElevatedButton.icon(
              icon: const Icon(Icons.camera_alt_rounded),
              onPressed: () async {
                final String? response =
                    await FlutterLivenessDetectionRandomizedPlugin.instance
                        .livenessDetection(
                  context: context,
                  shuffleListWithSmileLast: false,
                  isEnableSnackBar: true,
                  config: LivenessDetectionConfig(
                    startWithInfoScreen: true,
                  ),
                );
                setState(() {
                  imgPath = response;
                });
              },
              label: const Text('Liveness Detection System')),
        ],
      )),
    );
  }
}
9
likes
140
points
214
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for liveness detection with randomized challenge response method

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

camera, camera_android_camerax, collection, equatable, flutter, google_mlkit_face_detection, image, lottie, plugin_platform_interface

More

Packages that depend on flutter_liveness_detection_randomized_plugin