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"
	}

Libraries

block/verification_bloc/verification_bloc
data/core/failure
data/core/transaltor
data/core/user
data/helper/null_check
data/verification/id_card
data/verification/verification_failure
data/verification/verification_repository
lapisekyc
repository/core/api_repository
repository/core/genders
repository/core/id_types
repository/helper/map_visa_status
repository/helper/null_check
repository/regsitration/kyc_request_dto
repository/verification/document_verification_dto
repository/verification/face_verification_dto
ui/confirmation/confirmation
ui/confirmation/constants/text_content
ui/confirmation/helpers/date_converter
ui/core/constants/colors
ui/core/constants/face_verfication_test
ui/core/constants/icons
ui/core/constants/id_types
ui/core/constants/language
ui/core/constants/nationalities
ui/core/constants/selection_mapper
ui/core/constants/steps_text
ui/core/constants/verification_informations
ui/core/constants/verification_steps
ui/core/constants/visa_status
ui/core/widgets/camera_view
ui/core/widgets/error_modal
ui/core/widgets/slogan_widget
ui/face_verification/constants/progress_gradient
ui/face_verification/constants/text_content
ui/face_verification/constants/verification_tests
ui/face_verification/face_verification
ui/id_verification/constants/text_content
ui/id_verification/helpers/translate_docment_name
ui/id_verification/id_verification
ui/id_verification/widgets/camera_frame_painter
ui/info_id/constants/text_content
ui/info_id/info_id_photo
ui/photo_requirements/constants/text_content
ui/photo_requirements/photo_requirements
ui/prepare/constants/text_content
ui/prepare/prepare
ui/registration/constants/genders
ui/registration/constants/text_content
ui/registration/helpers/converter
ui/registration/helpers/form_validation
ui/registration/registration
ui/selfie/constants/prepare_text_content
ui/selfie/constants/requirements_text_content
ui/selfie/selfie_id
ui/selfie/take_selfie
ui/steps_verify/constants/text_content
ui/steps_verify/steps_verify