secugen_fp_capture 0.0.2 copy "secugen_fp_capture: ^0.0.2" to clipboard
secugen_fp_capture: ^0.0.2 copied to clipboard

PlatformAndroid

Flutter plugin to capture finger prints as an image

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter/services.dart';
import 'package:secugen_fp_capture/secugen_fp_capture.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  List<Uint8List?> imageData = [];
  String? error;
  final _secugenFpCapturePlugin = SecugenFpCapture();

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Column(
            children: [
              if (error != null) Text(error!),
              Expanded(
                child: (imageData.isNotEmpty)
                    ? GridView.builder(
                        gridDelegate:
                            const SliverGridDelegateWithFixedCrossAxisCount(
                          crossAxisCount: 3,
                        ),
                        itemBuilder: (context, index) {
                          return Container(
                            padding: const EdgeInsets.symmetric(horizontal: 10),
                            child: Image.memory(
                              width: 100,
                              height: 200,
                              imageData[index]!,
                            ),
                          );
                        },
                        itemCount: imageData.length,
                      )
                    : Container(),
              ),
              ElevatedButton(
                onPressed: () {
                  _captureFingerPrint();
                },
                child: const Text('Capture Fingerprint'),
              ),
            ],
          ),
        ),
      ),
    );
  }

  _captureFingerPrint() async {
    try {
      final result = await _secugenFpCapturePlugin.captureFingerprint();
      imageData.add(result);

      // print('imageData');
      // print(imageData);
      error = null;

      setState(() {});
    } on PlatformException catch (e) {
      print('error is $e');
      error = e.message;
      setState(() {});
    }
  }
}
0
likes
140
points
23
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter plugin to capture finger prints as an image

Homepage

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on secugen_fp_capture