BioPass ID Fingerprint SDK Flutter
Quick Start Guide • Prerequisites • Installation • How to use • LicenseKey • Getting capture status and finger position • FingerprintConfig • Something else • Changelog • Support
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:
| Android | iOS | |
|---|---|---|
| Support | SDK 21+ | iOS 15+ |
- A 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 21 (or higher) in your android/app/build.gradle file.
minSdkVersion 21
iOS
Requires iOS 15.0 or higher.
Add to the ios/Info.plist:
- the key
Privacy - Camera Usage Descriptionand 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
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',
showDistanceIndicatorView: true,
showFingerEllipseView: true,
captureType: FingerprintCaptureType.leftHandFingers,
outputType: FingerprintOutputType.captureAndSegmentation,
numberFingersToCapture: 4,
);
controller = FingerprintController(
config: config,
onStatusChanged: (FingerprintCaptureState state) {
print('onStatusChanged: $state');
},
onFingerDetected: (List<Rect> fingerRects) {
print('onFingerDetected: $fingerRects');
},
);
}
void takeFingerprint() async {
final images = await controller.takeFingerprint();
print('onFingerCaptured: ${images[0][0]}');
}
@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:
void onStatusChanged(FingerprintCaptureState state) {
print('onStatusChanged: $state');
}
void onFingerDetected(List<Rect> fingerRects) {
print('onFingerDetected: $fingerRects');
}
void takeFingerprint() async {
final config = FingerprintConfig(licenseKey: 'your-license-key');
final controller = FingerprintController(
config: config,
onStatusChanged: onStatusChanged,
onFingerDetected: onFingerDetected,
);
final images = await controller.takeFingerprint();
print('onFingerCaptured: ${images[0][0]}');
}
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 | '' |
| showDistanceIndicatorView | bool | true |
| showFingerEllipseView | bool | true |
| captureType | FingerprintCaptureType | FingerprintCaptureType.leftHandFingers |
| outputType | FingerprintOutputType | FingerprintOutputType.captureAndSegmentation |
| numberFingersToCapture | int | 4 |
| fontFamily | String | 'fingerprintsdk_opensans_regular' |
| overlayColor | Color | Color(0x80000000) |
| fingerColor | Color | Color(0x80D6A262) |
| distanceIndicatorLineColor | Color | Color(0xFFFFFFFF) |
| distanceIndicatorHighlightColor | Color | Color(0xFFD6A262) |
| helpText | FingerprintHelpTextOptions | |
| tooCloseText | FingerprintTextOptions | |
| tooFarText | FingerprintTextOptions | |
| backButton | FingerprintButtonOptions |
Default configs:
final defaultConfig = FingerprintConfig(
licenseKey: '',
showDistanceIndicatorView: true,
showFingerEllipseView: true,
captureType: FingerprintCaptureType.leftHandFingers,
outputType: FingerprintOutputType.captureAndSegmentation,
numberFingersToCapture: 4,
fontFamily: 'fingerprintsdk_opensans_regular',
overlayColor: const Color(0x80000000),
fingerColor: const Color(0x80D6A262),
distanceIndicatorLineColor: const Color(0xFFFFFFFF),
distanceIndicatorHighlightColor: const Color(0xFFD6A262),
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,
),
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,
),
backButton: FingerprintButtonOptions(
enabled: true,
backgroundColor: const Color(0x00000000),
buttonPadding: 0,
buttonSize: const Size(56, 56),
iconOptions: FingerprintIconOptions(
enabled: true,
iconFile: 'fingerprint_ic_close',
iconColor: const Color(0xFFFFFFFF),
iconSize: const Size(32, 32),
),
labelOptions: FingerprintTextOptions(
enabled: false,
content: 'Voltar',
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 | SignatureIconOptions | SignatureIconOptions() |
| labelOptions | SignatureTextOptions | SignatureTextOptions() |
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.' |
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:
- In Xcode, select the Project navigator.
- Drag your fonts from a Finder window into your project. This copies the fonts to your project.
- 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:
- In the Project navigator, select an asset catalog: a file with a .xcassets file extension.
- 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.
- Face SDK
- Fingerprint SDK
- Signature SDK
Changelog
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.