rubi_lapisekyc 0.0.2 copy "rubi_lapisekyc: ^0.0.2" to clipboard
rubi_lapisekyc: ^0.0.2 copied to clipboard

A Flutter package to include lapisKYC to your flutter app

How to use the lapiskyc flutter package #

- Using package from file #

Preparing assets #

Copy the assets folder inside the flutter package to your app root folder

Copy env.production and .env.example from the flutter package to your app root folder

Create .env file with the content of env.example in your root folder

Add the above assets to your pubspec.yaml

Adding lapiskyc package #

Clone the package or place the package folder in the desired location
Add the package to your pubspec.yaml under dependencies as shown below (the below path is if the package and your app are at the same level of folder structure, replaced with the path of your package location). Change the path to the folder name and location you places the package

- Using published package #

  • Method 1
If you are using vs code add lapisekyc: ^0.0.4 under dependencies in side your pubspec.yaml file and save the file vs code with automatically download the package for you
  • Method 2
Inside your project run the following command to add the package 
flutter pub add lapisekyc 

- Common configurations #

  • Configurations
Go to android/app/build.gradle and add minSdkVersion 21
and targetSdkVersion 33 under defaultConfig as shown below.


Next add internet permission. Navigate to android/src/main/AndroidManifest.xml and add internet access permission <uses-permission android:name="android.permission.INTERNET"/> as shown below.

- Importing and usage #

Import the package like so 
import 'package:lapisekyc/lapisekyc.dart';

To initialize the package, call the LapisKyc() class. This class has 2 optional parameters: routeContext and onSuccess.

routeContext: With this parameter you pass your app context so that the package can navigate back to your application after a successful verification.

onSuccess: With this parameter you pass a function that initializes the page you want to be displayed after successful verification. The package will pass users ID card information through this function. Your function argument type should be Map<String, dynamic>. The returned data will have the below structure. Note that all fields may not be returned every time depending on what was possible to extract from the ID card.
{
		"documentNumber": "",
		"firstName": "",
		"middleName": "",
		"lastName": "",
		"fullName": "",
		"age": 25,
		"dob": "1998/02/15",
		"dob_day": 15,
		"dob_month": 2,
		"dob_year": 1998,
		"expiry": "2024/03/15",
		"expiry_day": 15,
		"expiry_month": 3,
		"expiry_year": 2024,
		"daysToExpiry": 234,
		"issued": "2021/07/07",
		"issued_day": 7,
		"issued_month": 7,
		"issued_year": 2021,
		"daysFromIssue": 749,
		"address1": "address",
		"documentType": "D",
		"documentSide": "DUAL",
		"issueAuthority": "東京都",
		"issuerOrg_full": "Japan",
		"issuerOrg_iso2": "JP",
		"issuerOrg_iso3": "JPN",
		"nationality_full": "Japan",
		"nationality_iso2": "JP",
		"nationality_iso3": "JPN",
		"internalId": "674"
	}