biopassid_fingerprint_sdk 2.0.2 copy "biopassid_fingerprint_sdk: ^2.0.2" to clipboard
biopassid_fingerprint_sdk: ^2.0.2 copied to clipboard

BioPass ID Fingerprint SDK Flutter plugin.

BioPass ID

BioPass ID Fingerprint SDK Flutter

Flutter Pub Instagram BioPass ID Contact us

Quick Start GuidePrerequisitesInstallationHow to useLicenseKeyGetting capture status and finger positionFingerprintConfigSomething elseChangelogSupport

Quick Start Guide #

First, you will need a license key to use the biopassid_fingerprint_sdk. To get your license key contact us through our website BioPass ID. #

Check out our official documentation for more in depth information on BioPass ID.

1. Prerequisites: #

Attention: To use Fingerprint you will need a physical device, Fingerprint does not work on emulators.

Android iOS
Support SDK 23+ iOS 15+
- A physical device with a camera
- License key
- Internet connection is required to verify the license

2. Installation #

First, add biopassid_fingerprint_sdk as a dependency in your pubspec.yaml file.

Android #

Change the minimum Android sdk version to 23 (or higher) in your android/app/build.gradle file.

minSdkVersion 23

iOS #

Requires iOS 15.0 or higher.

Add to the ios/Info.plist:

  • the key Privacy - Camera Usage Description and a usage description.

If editing Info.plist as text, add:

<key>NSCameraUsageDescription</key>
<string>Your camera usage description</string>

Then go into your project's ios folder and run pod install.

# Go into ios folder
$ cd ios

# Install dependencies
$ pod install

Privacy manifest file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>NSPrivacyCollectedDataTypes</key>
	<array>
		<dict>
			<key>NSPrivacyCollectedDataType</key>
			<string>NSPrivacyCollectedDataTypeOtherUserContent</string>
			<key>NSPrivacyCollectedDataTypeLinked</key>
			<false/>
			<key>NSPrivacyCollectedDataTypeTracking</key>
			<false/>
			<key>NSPrivacyCollectedDataTypePurposes</key>
			<array>
				<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
			</array>
		</dict>
		<dict>
			<key>NSPrivacyCollectedDataType</key>
			<string>NSPrivacyCollectedDataTypeDeviceID</string>
			<key>NSPrivacyCollectedDataTypeLinked</key>
			<false/>
			<key>NSPrivacyCollectedDataTypeTracking</key>
			<false/>
			<key>NSPrivacyCollectedDataTypePurposes</key>
			<array>
				<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
			</array>
		</dict>
	</array>
	<key>NSPrivacyTracking</key>
	<false/>
	<key>NSPrivacyAccessedAPITypes</key>
	<array>
		<dict>
			<key>NSPrivacyAccessedAPITypeReasons</key>
			<array>
				<string>CA92.1</string>
			</array>
			<key>NSPrivacyAccessedAPIType</key>
			<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
		</dict>
	</array>
</dict>
</plist>

3. How to use #

To call Fingerprint in your Flutter project is as easy as follow:

import 'package:flutter/material.dart';
import 'package:biopassid_fingerprint_sdk/biopassid_fingerprint_sdk.dart';
import 'dart:typed_data';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Fingerprint Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

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

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late FingerprintController controller;

  @override
  void initState() {
    super.initState();
    final config = FingerprintConfig(licenseKey: 'your-license-key');
    controller = FingerprintController(
      config: config,
      onFingerCapture: (images, error) {
        if (error != null) {
          print('onFingerCaptured: $error');
        } else {
          print('onFingerCaptured: ${images[0][0]}');
        }
      },
      onStatusChanged: (FingerprintCaptureState state) {
        print('onStatusChanged: $state');
      },
      onFingerDetected: (List<Rect> fingerRects) {
        print('onFingerDetected: $fingerRects');
      },
    );
  }

  void takeFingerprint() async {
    await controller.takeFingerprint();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Fingerprint Demo'),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: takeFingerprint,
          child: const Text('Capture Fingers'),
        ),
      ),
    );
  }
}

4. LicenseKey #

First, you will need a license key to use the biopassid_fingerprint_sdk. To get your license key contact us through our website BioPass ID. #

To use biopassid_fingerprint_sdk you need a license key. To set the license key needed is simple as setting another attribute. Simply doing:

final config = FingerprintConfig(licenseKey: 'your-license-key');

5. Getting capture status and finger position #

You can get the capture status and finger position by passing callback functions when calling takeFingeprint. You can write you own listener following this example:

final controller = FingerprintController(
  config: FingerprintConfig(licenseKey: 'your-license-key'),
  onFingerCapture: (images, error) {
    if (error != null) {
      print('onFingerCaptured: $error');
    } else {
      print('onFingerCaptured: ${images[0][0]}');
    }
  },
  onStatusChanged: (FingerprintCaptureState state) {
    print('onStatusChanged: $state');
  },
  onFingerDetected: (List<Rect> fingerRects) {
    print('onFingerDetected: $fingerRects');
  },
);
await controller.takeFingerprint();

FingerprintCaptureState (enum) #

Name
FingerprintCaptureState.noDetection
FingerprintCaptureState.missingFingers
FingerprintCaptureState.tooClose
FingerprintCaptureState.tooFar
FingerprintCaptureState.ok
FingerprintCaptureState.stopped
FingerprintCaptureState.processing
FingerprintCaptureState.modelNotFound

FingerprintConfig #

FingerprintConfig #

Variable name Type Default value
licenseKey String ''
numberFingersToCapture int 4
fontFamily String 'fingerprintsdk_opensans_regular'
overlayColor Color Color(0x80000000)
captureType FingerprintCaptureType FingerprintCaptureType.leftHandFingers
outputType FingerprintOutputType FingerprintOutputType.captureAndSegmentation
backButton FingerprintButtonOptions
helpText FingerprintHelpTextOptions
fingerEllipse FingerprintFingerEllipseOptions
distanceIndicator FingerprintDistanceIndicatorOptions

Default configs:

final defaultConfig = FingerprintConfig(
  licenseKey: '',
  numberFingersToCapture: 4,
  fontFamily: 'fingerprintsdk_opensans_regular',
  overlayColor: const Color(0x80000000),
  captureType: FingerprintCaptureType.leftHandFingers,
  outputType: FingerprintOutputType.captureAndSegmentation,
  backButton: FingerprintButtonOptions(
    enabled: true,
    backgroundColor: const Color(0x00000000),
    buttonPadding: 0,
    buttonSize: const Size(56, 56),
    iconOptions: FingerprintIconOptions(
      enabled: true,
      iconFile: 'fingerprintsdk_ic_close',
      iconColor: const Color(0xFFFFFFFF),
      iconSize: const Size(32, 32),
    ),
    labelOptions: FingerprintTextOptions(
      enabled: false,
      content: 'Voltar',
      textColor: const Color(0xFFFFFFFF),
      textSize: 14,
    ),
  ),
  helpText: FingerprintHelpTextOptions(
    enabled: true,
    messages: FingerprintHelpTextMessages(
      leftHandMessage:
          'Encaixe a mão esquerda (sem o polegar)\naté o marcador ficar centralizado.',
      rightHandMessage:
          'Encaixe a mão direita (sem o polegar)\naté o marcador ficar centralizado.',
      thumbsMessage:
          'Encaixe os polegares\naté o marcador ficar centralizado.',
    ),
    textColor: const Color(0xFFFFFFFF),
    textSize: 14,
  ),
  fingerEllipse: FingerprintFingerEllipseOptions(
    enabled: true,
    ellipseColor: const Color(0x80D6A262),
  ),
  distanceIndicator: FingerprintDistanceIndicatorOptions(
    enabled: true,
    selectedBarColor: const Color(0xFFD6A262),
    unselectedBarColor: const Color(0xFFFFFFFF),
    arrowColor: const Color(0xFFD6A262),
    tooCloseText: FingerprintTextOptions(
      enabled: true,
      content: 'Muito perto',
      textColor: const Color(0xFFFFFFFF),
      textSize: 14,
    ),
    tooFarText: FingerprintTextOptions(
      enabled: true,
      content: 'Muito longe',
      textColor: const Color(0xFFFFFFFF),
      textSize: 14,
    ),
  ),
);

FingerprintCaptureType (enum) #

Name
FingerprintCaptureType.rightHandFingers
FingerprintCaptureType.leftHandFingers
FingerprintCaptureType.thumbs

FingerprintOutputType (enum) #

Name
FingerprintOutputType.onlyCapture
FingerprintOutputType.captureAndSegmentation

FingerprintButtonOptions #

Name Type Default value
enabled bool true
backgroundColor Color Color(0x00000000)
buttonPadding int 0
buttonSize Size Size(56, 56)
iconOptions FingerprintIconOptions FingerprintIconOptions()
labelOptions FingerprintTextOptions FingerprintTextOptions()

FingerprintIconOptions #

Name Type Default value
enabled bool true
iconFile String 'fingerprint_ic_close'
iconColor Color Color(0xFFFFFFFF)
iconSize Size Size(32, 32)

FingerprintTextOptions #

Name Type Default value
enabled bool true
content String ''
textColor Color Color(0xFFFFFFFF)
textSize int 14

FingerprintHelpTextOptions #

Name Type Default value
enabled bool true
messages FingerprintHelpTextMessages FingerprintHelpTextMessages()
textColor Color Color(0xFFFFFFFF)
textSize int 14

FingerprintHelpTextMessages #

Name Type Default value
leftHandMessage String 'Encaixe a mão esquerda (sem o polegar)\naté o marcador ficar centralizado.'
rightHandMessage String 'Encaixe a mão direita (sem o polegar)\naté o marcador ficar centralizado.'
thumbsMessage String 'Encaixe os polegares\naté o marcador ficar centralizado.'

FingerprintFingerEllipseOptions #

Name Type Default value
enabled bool true
ellipseColor Color Color(0x80D6A262)

FingerprintDistanceIndicatorOptions #

Name Type Default value
enabled bool true
selectedBarColor Color Color(0xFFD6A262)
unselectedBarColor Color Color(0xFFFFFFFF)
arrowColor Color Color(0xFFD6A262)
tooCloseText FingerprintTextOptions FingerprintTextOptions()
tooFarText FingerprintTextOptions FingerprintTextOptions()

How to change font family #

on Android side #

You can use the default font family or set one of your own. To set a font family, create a folder font under res directory in your android/app/src/main/res. Download the font which ever you want and paste it inside font folder. All font file names must be only: lowercase a-z, 0-9, or underscore. The structure should be some thing like below.

on iOS side #

To add the font files to your Xcode project:

  1. In Xcode, select the Project navigator.
  2. Drag your fonts from a Finder window into your project. This copies the fonts to your project.
  3. Select the font or folder with the fonts, and verify that the files show their target membership checked for your app’s targets.

Then, add the "Fonts provided by application" key to your app’s Info.plist file. For the key’s value, provide an array of strings containing the relative paths to any added font files.

In the following example, the font file is inside the fonts directory, so you use fonts/roboto_mono_bold_italic.ttf as the string value in the Info.plist file.

on Dart side #

Finally, just set the font family passing the name of the font file when instantiating FingerprintConfig in your Flutter app.

final config = FingerprintConfig(
  licenseKey: 'your-license-key',
  fontFamily: 'roboto_mono_bold_italic'
);

How to change icon #

on Android side #

You can use the default icons or define one of your own. To set a icon, download the icon which ever you want and paste it inside drawable folder in your android/app/src/main/res. All icon file names must be only: lowercase a-z, 0-9, or underscore. The structure should be some thing like below.

on iOS side #

To add icon files to your Xcode project:

  1. In the Project navigator, select an asset catalog: a file with a .xcassets file extension.
  2. Drag an image from the Finder to the outline view. A new image set appears in the outline view, and the image asset appears in a well in the detail area.

on Dart side #

Finally, just set the icon passing the name of the icon file when instantiating FingerprintConfig in your Flutter app.

final config = FingerprintConfig(licenseKey: 'your-license-key');
// Changing back button icon
config.backButton.iconOptions.iconFile = 'ic_baseline_camera';

Something else #

Do you like the Fingerprint SDK and would you like to know about our other products? We have solutions for face detection and digital signature capture.

Changelog #

2.0.2 #

  • Documentation update;
  • Upgrade minSdkVersion to 23 on Android;
  • Upgrade to Kotlin 1.9.10 on Android;
  • Added privacy manifest file on iOS.

2.0.1 #

  • Documentation update;
  • Bug fixes.

2.0.0 #

  • Documentation update;
  • FingerprintConfig refactoring:
    • Removed showFingerEllipseView and fingerColor, they are now in a new configuration class called FingerprintFingerEllipseOptions;
    • Removed showDistanceIndicatorView, distanceIndicatorLineColor, distanceIndicatorHighlightColor, tooCloseText and tooFarText, now they are in a new configuration class called FingerprintDistanceIndicatorOptions.

1.0.2 #

  • Documentation update;
  • Focus improvement for Android.

1.0.1 #

  • Documentation update;
  • Fixed back button padding for Android;
  • Fixed bug that caused a crash when pressing the back button for Android.

1.0.0 #

  • Documentation update;
  • Refactoring in onFingerCapture:
    • Now, in addition to the image list, an error message is also returned.
  • Removed automatic restart in case of fingerprint extraction failure:
    • Now, if the fingerprint extraction fails, a String will be returned with an error message.

Before #

final controller = FingerprintController(
  config: FingerprintConfig(licenseKey: 'your-license-key'),
);
final images = await controller.takeFingerprint();
print('onFingerCaptured: ${images[0][0]}');

Now #

final controller = FingerprintController(
  config: FingerprintConfig(licenseKey: 'your-license-key'),
  onFingerCapture: (images, error) {
    if (error != null) {
      print('onFingerCaptured: $error');
    } else {
      print('onFingerCaptured: ${images[0][0]}');
    }
  },
);
await controller.takeFingerprint();

0.1.4 #

  • Documentation update;
  • Bug fixes.

0.1.3 #

  • Documentation update;
  • Bug fixes.

0.1.2 #

  • Documentation update;
  • Fix in focus and exposure mode for Android.

0.1.1 #

  • Documentation update;
  • Correction in the resolution of the returned images for iOS;
  • Improvement in focus and exposure mode for Android.

0.1.0 #

  • Documentation update;
  • Removal of FingerprintCaptureListener;
  • Customizable UI.

0.0.10 #

  • Documentation update;
  • Focus adjustments for Android.

0.0.9 #

  • Documentation update;
  • License functionality fix for iOS.

0.0.8 #

  • Documentation update.

0.0.7 #

  • Documentation update;
  • Improved license functionality for iOS.

0.0.6 #

  • Finger capture;
  • Fingers segmentation;
  • Parameterizable distance, status and fingers indicators.
  • Documentation update;
  • dlib bug fix;
  • New licensing feature;
  • Finger indicator fix.
4
likes
135
pub points
61%
popularity

Publisher

verified publisherbiopassid.com

BioPass ID Fingerprint SDK Flutter plugin.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on biopassid_fingerprint_sdk