dojah_kyc 0.1.0+1 dojah_kyc: ^0.1.0+1 copied to clipboard
Unofficial Dojah KYC widget
Dojah Kyc #
Unofficail Dojah KYC widget
Installation 💻 #
❗ In order to start using Dojah Kyc you must add necessary permissions for Camera and/or Location in your AndroidManifext.xml file for Android and info.plist for iOS
To use the widget in your Flutter project, add the following dependency to your pubspec.yaml
file:
dependencies:
dojah_kyc: 0.1.0+1 # Replace with the latest version
Then run:
flutter pub get
Usage #
Import the package in your Dart file:
import 'package:dojah_kyc/dojah_kyc.dart';
Example #
await DojahKyc(
config: const DojahConfig(
publicKey: "your key",
appId: 'your app id',
type: 'custom',
config: {
'widget_id': optional widget id,
// "pages": [
// {
// "page": "user-data",
// "config": {"enabled": false}
// },
// {
// "page": "government-data",
// "config": {"bvn": true, "selfie": true}
// },
// ]
}),
showLogs: true,
onClosed: () {
print('closed');
Navigator.pop(context);},
onSuccess: (v) {
print(v.toString());
Navigator.pop(context);
},
onError: (){},
).show(context);
Parameters #
-
config (required): An instance of
DojahConfig
containing the necessary information for the verification process. Refer to https://api-docs.dojah.io/docs/flutter-sdk for detailed reference. -
showLogs (optional): A boolean flag indicating whether to show logs during the verification process. Default is
false
. -
onClosed (optional): A callback function that gets triggered when the widget is closed.
-
onSuccess (optional): A callback function that gets triggered when the verification is successful. It receives a dynamic parameter representing the success response.
-
onError (optional): A callback function that gets triggered when an error occurs during the verification process. It receives an error message as a parameter.