Q818 Device Fingerprint SDK Plugin for Flutter

This Flutter plugin provides a simple bridge to native Q818 fingerprint hardware SDKs using Platform Channels.
It allows developers to capture fingerprint images, generate templates (ISO/ANSI), and perform template matching.


✨ Features

  • Open and close the fingerprint device
  • Capture fingerprint images
  • Generate ISO and ANSI templates
  • Compare fingerprint templates for matching
  • Works with custom hardware SDKs via native integration (Java/Kotlin, Swift/Objective-C)

πŸ“¦ Installation

Add the dependency in your Flutter project:

dependencies:
  fingerprint_sdk:
    path: ./fingerprint_sdk

Then run:

flutter pub get

βΈ»

πŸš€ Usage

Import the plugin:

import 'package:fingerprint_sdk/fingerprint_sdk.dart';

Example

final sdk = FingerprintSdk();

// Open device
final handle = await sdk.openDevice();
print("Device Handle: $handle");

// Capture fingerprint image
final imageBase64 = await sdk.captureImage();
print("Captured Image (Base64): $imageBase64");

// Create ISO template
final isoTemplate = await sdk.createISOTemplate(imageBase64!);
print("ISO Template: $isoTemplate");

// Create ANSI template
final ansiTemplate = await sdk.createANSITemplate(imageBase64);
print("ANSI Template: $ansiTemplate");

// Compare templates
final score = await sdk.compareTemplates(isoTemplate!, ansiTemplate!);
print("Match Score: $score");

// Close device
await sdk.closeDevice();

βΈ»

πŸ“‚ Project Structure

fingerprint_sdk/
β”œβ”€ .dart_tool/
β”‚  β”œβ”€ extension_discovery/
β”‚  β”‚  β”œβ”€ README.md
β”‚  β”‚  └─ vs_code.json
β”‚  β”œβ”€ package_config.json
β”‚  β”œβ”€ package_graph.json
β”‚  └─ version
β”œβ”€ android/
β”‚  β”œβ”€ gradle/
β”‚  β”‚  └─ wrapper/
β”‚  β”‚     └─ gradle-wrapper.properties
β”‚  β”œβ”€ src/
β”‚  β”‚  β”œβ”€ main/
β”‚  β”‚  β”‚  β”œβ”€ java/
β”‚  β”‚  β”‚  β”‚  └─ com/
β”‚  β”‚  β”‚  β”‚     β”œβ”€ example/
β”‚  β”‚  β”‚  β”‚     β”‚  └─ fingerprint_sdk/
β”‚  β”‚  β”‚  β”‚     β”‚     └─ FingerprintSdkPlugin.java
β”‚  β”‚  β”‚  β”‚     └─ HZFINGER/
β”‚  β”‚  β”‚  β”‚        β”œβ”€ HAPI.java
β”‚  β”‚  β”‚  β”‚        β”œβ”€ HostUsb.java
β”‚  β”‚  β”‚  β”‚        └─ LAPI.java
β”‚  β”‚  β”‚  β”œβ”€ jniLibs/
β”‚  β”‚  β”‚  β”‚  β”œβ”€ arm64-v8a/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ libbiofp_e_lapi.so
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ libcheckLive.so
β”‚  β”‚  β”‚  β”‚  β”‚  └─ libFingerILA.so
β”‚  β”‚  β”‚  β”‚  β”œβ”€ armeabi/
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ libbiofp_e_lapi.so
β”‚  β”‚  β”‚  β”‚  β”‚  β”œβ”€ libcheckLive.so
β”‚  β”‚  β”‚  β”‚  β”‚  └─ libFingerILA.so
β”‚  β”‚  β”‚  β”‚  └─ armeabi-v7a/
β”‚  β”‚  β”‚  β”‚     β”œβ”€ libbiofp_e_lapi.so
β”‚  β”‚  β”‚  β”‚     β”œβ”€ libcheckLive.so
β”‚  β”‚  β”‚  β”‚     └─ libFingerILA.so
β”‚  β”‚  β”‚  β”œβ”€ kotlin/
β”‚  β”‚  β”‚  β”‚  └─ com/
β”‚  β”‚  β”‚  β”‚     └─ example/
β”‚  β”‚  β”‚  β”‚        └─ fingerprint_sdk/
β”‚  β”‚  β”‚  β”‚           β”œβ”€ FingerprintSdkPlugin.kt
β”‚  β”‚  β”‚  β”‚           └─ FingerprintSdkPlugin.txt
β”‚  β”‚  β”‚  └─ AndroidManifest.xml
β”‚  β”‚  └─ test/
β”‚  β”‚     └─ kotlin/
β”‚  β”‚        └─ com/
β”‚  β”‚           └─ example/
β”‚  β”‚              └─ fingerprint_sdk/
β”‚  β”‚                 └─ FingerprintSdkPluginTest.kt
β”‚  β”œβ”€ .gitignore
β”‚  β”œβ”€ build.gradle
β”‚  β”œβ”€ fingerprint_sdk_android.iml
β”‚  β”œβ”€ local.properties
β”‚  └─ settings.gradle
β”œβ”€ example/
β”œβ”€ lib/
β”‚  β”œβ”€ fingerprint_sdk_method_channel.dart
β”‚  β”œβ”€ fingerprint_sdk_platform_interface.dart
β”‚  └─ fingerprint_sdk.dart
β”œβ”€ test/
β”‚  β”œβ”€ fingerprint_sdk_method_channel_test.dart
β”‚  └─ fingerprint_sdk_test.dart
β”œβ”€ .gitignore
β”œβ”€ .metadata
β”œβ”€ analysis_options.yaml
β”œβ”€ CHANGELOG.md
β”œβ”€ fingerprint_sdk.iml
β”œβ”€ LICENSE
β”œβ”€ pubspec.lock
β”œβ”€ pubspec.yaml
└─ README.md

βΈ»

βš™οΈ API Reference

Method Parameters Returns Description
openDevice() none Future<int?> Opens the fingerprint device, returning a handle or null if it fails.
captureImage() none Future<String?> Captures a fingerprint image and returns it as a Base64-encoded string.
createISOTemplate() String imageBase64 Future<String?> Generates an ISO fingerprint template from a captured image.
createANSITemplate() String imageBase64 Future<String?> Generates an ANSI fingerprint template from a captured image.
compareTemplates() String t1, String t2 Future<int?> Compares two templates and returns a similarity score.
closeDevice() none Future<int?> Closes the fingerprint device.

πŸ”§ Platform Support

  • Android: Implemented via FingerprintSdkPlugin.java
  • iOS: Implementation pending (Swift/Objective-C)

πŸ›  Development Notes

  • Ensure native SDK libraries required by your fingerprint hardware (such as .so, .dll, or .framework files) are correctly integrated into your Android/iOS projects.
  • This plugin communicates between Dart and native code using Flutter’s MethodChannel (fingerprint_sdk).
  • The ISO and ANSI templates are returned as Base64-encoded strings for easy storage and transmission.

πŸ–Ό Workflow Overview

Fingerprint Device
↓
Capture Image (Base64)
↓
Generate Template (ISO / ANSI)
↓
Store or Compare Templates

πŸ“„ License

This project is licensed under the MIT License. Use it at your own risk and ensure compliance with your hardware vendor’s SDK terms.