Unico Check Flutter SDK
The Unico Check Flutter SDK provides a wrapper for the native Unico Check SDKs (iOS and Android), enabling you to integrate liveness detection and document capture functionalities into your Flutter application.
Features
- Selfie Capture: Supports different modes for capturing selfies.
- Normal
- Smart (with automatic capture)
- Smart with a manual capture button
- Document Capture: Capture various types of official documents.
- CNH (Brazilian Driver's License) - Full, Front, and Verso
- RG (Brazilian ID Card) - Front and Verso
- CPF (Brazilian Individual Taxpayer Registry)
- Customization:
- Apply custom themes to match your app's branding.
- Configure session timeouts.
- Callbacks: Listen for success, error, and user action events.
Requirements
General
- Flutter:
>=1.20.0 - Dart:
>=2.15.0 <4.0.0
Android
- minSdkVersion:
21 - Kotlin Version:
1.7.10
iOS
- Platform Version:
12.0or higher - Swift Version:
5.4 - Xcode: 16 or higher
Native Dependencies
This plugin is a wrapper around the native Unico SDKs. The versions used are:
- Android:
io.unico:capture - iOS:
unicocheck-ios
Flutter Installation
First, you need to have Flutter installed on your machine. If you don't have it installed, please follow the official documentation for your operating system:
Installation
Add the unico_check dependency to your project's pubspec.yaml file:
dependencies:
unico_check: ^4.40.0 # Use the latest version
Then, run flutter pub get to install the package.
Running the Example Project
To run the example project:
- Navigate to the
exampledirectory:cd example - Install dependencies:
flutter pub get - Run the app:
flutter run
How to Generate a New Release
This project has an automated release process that simplifies the creation of new releases.
Automatic Release (Recommended)
The automatic release process is handled by two GitHub Actions workflows: bump_version.yml and release.yml.
1. Bumping the version (bump_version.yml)
This workflow is triggered manually and automates the process of updating the version number and changelog.
How to use it:
- Go to the Actions tab of the repository.
- Select the Bump version workflow from the list.
- Click on Run workflow.
- Fill in the required information:
- New version: The new version of the package (e.g.,
4.42.0). - New Android version (optional): The new version of the native Android SDK.
- New iOS version (optional): The new version of the native iOS SDK.
- New version: The new version of the package (e.g.,
- Click on Run workflow.
What it does:
- Runs the
scripts/release.shscript, which:- Updates the version in
pubspec.yaml. - Updates the native SDK versions in
android/build.gradleandios/unico_check.podspec. - Adds a new entry to
CHANGELOG.mdwith the new version and release notes.
- Updates the version in
- Creates a new pull request with the changes.
2. Releasing the package (release.yml)
This workflow is triggered automatically when a pull request is merged into the main branch.
How to use it:
- Review and approve the pull request created by the Bump version workflow.
- Merge the pull request into the
mainbranch.
What it does:
- Gets the version from
pubspec.yaml. - Creates a new Git tag and a GitHub Release with the version number.
- Publishes the package to pub.dev.
Manual Release
Manual Release
If you prefer to perform the release process manually, you can follow these steps. These steps are the manual equivalent of the automated workflows.
-
Update the version and changelog:
- Update the version number in
pubspec.yaml. - Update the native SDK versions in
android/build.gradleandios/unico_check.podspec. - Add a new entry in
CHANGELOG.mdwith the changes for the new version.
- Update the version number in
-
Create a commit and a pull request:
- Commit the changes with a message like
feat: release vX.Y.Z. - Create a pull request targeting the
mainbranch.
- Commit the changes with a message like
-
Merge the pull request:
- Once the PR is reviewed and approved, merge it into
main.
- Once the PR is reviewed and approved, merge it into
-
Create a tag and a release:
- Create a new tag for the release:
git tag vX.Y.Z. - Push the tag to the remote repository:
git push origin vX.Y.Z. - Create a new release on GitHub, using the tag you just created.
- Create a new tag for the release:
-
Publish the package:
- Run
flutter pub publishto publish the package to pub.dev.
- Run
For more details
For more details, check out our documentation. https://devcenter.unico.io/unico-idcloud/integracao/sdk/integracao-sdks/sdk-flutter
License
This project is licensed under the terms of the LICENSE file.