dojah_kyc 0.1.0+2 dojah_kyc: ^0.1.0+2 copied to clipboard
Unofficial Dojah KYC widget
Dojah Kyc #
Unofficial 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: "test_pk_xxxxxxxxxxxx",
appId: 'xxxxxxxxxxxxxxxxxx',
type: 'custom',
configData: {
'widget_id': 'xxxxxxxxxxxxxx',
"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: (v) {
print(v.toString());
Navigator.pop(context);
},
).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.