This project provides a Flutter package for scanning South African identification documents. Supported documents include:
- South African ID Cards
- South African ID Books
- South African Driver's Licenses
Since this is a Flutter package, you will need to use it from within a Flutter App. A few resources to get you started with your first Flutter project:
Also, because this plugin makes use of Firebase ML Vision for scanning, you must configure Firebase for your project.
Add rsa_scan
as a dependency in your pubspec.yaml file.
First, configure Firebase for your iOS project.
Then, this package requires a minimum deployment target of 9.0. You can add the line platform :ios, '9.0' in your iOS project Podfile. You may also need to update your app's deployment target to 9.0 using Xcode. Otherwise, you may see compilation errors.
Finally, include MLVisionBarcodeModel
in your Podfile. Then run pod update in a terminal within the same directory as your Podfile.
pod 'Firebase/MLVisionBarcodeModel'
First, configure Firebase for your Android project.
Then, you will need to add the following dependencies in your app-level build.gradle file:
android{
dependencies {
...
implementation 'com.google.android.gms:play-services-vision:20.1.0'
implementation 'com.google.android.gms:play-services-vision-common:19.1.0'
}
}
Finally, add the following declaration to your app's AndroidManifest.xml file:
<application ...>
<!-- Used for firebase ML Vision -->
<meta-data
android:name="com.google.firebase.ml.vision.DEPENDENCIES"
android:value="barcode" />
</application>
The package exposes 3 functions, namely scanIdCard
, scanIdBook
and scanDrivers
.
A simple usage example of scanIdCard
:
import 'package:rsa_scan/rsa_scan.dart';
RsaIdCard idCard = await scanIdCard(context);
print(idCard.idNumber);
print(idCard.firstNames);
print(idCard.surname);
print(idCard.gender);
// See the API reference for the full set of available properties
A simple usage example of scanIdBook
:
import 'package:rsa_scan/rsa_scan.dart';
RsaIdBook idBook = await scanIdBook(context);
print(idBook.idNumber);
print(idBook.birthDate);
print(idBook.gender);
print(idBook.citizenshipStatus);
// See the API reference for the full set of available properties
A simple usage example of scanDrivers
:
import 'package:rsa_scan/rsa_scan.dart';
RsaDriversLicense driversLicense = await scanDrivers(context);
print(driversLicense.idNumber);
print(driversLicense.birthDate);
print(driversLicense.gender);
print(driversLicense.citizenshipStatus);
// See the API reference for the full set of available properties
For a more comprehensive example, please see the example application
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
BornIdeas - born.dev - [email protected]
Project Link: https://github.com/born-ideas/rsa_scan