presentVerificationFlow method
Future<void>
presentVerificationFlow({
- required BuildContext context,
- required String apiKey,
- required String kycLevel,
- String? firstName,
- String? lastName,
- String? uniqueId,
- String? phoneNumber,
- String? email,
- String? i18n,
- bool ageVerification = false,
- bool showCompletionView = true,
- VoidCallback? onVerificationCompleted,
- VoidCallback? onVerificationCancelled,
- dynamic onVerificationError()?,
Implementation
Future<void> presentVerificationFlow({
required BuildContext context,
required String apiKey,
required String kycLevel,
String? firstName,
String? lastName,
String? uniqueId,
String? phoneNumber,
String? email,
String? i18n,
bool ageVerification = false,
bool showCompletionView = true,
VoidCallback? onVerificationCompleted,
VoidCallback? onVerificationCancelled,
Function(String)? onVerificationError,
}) async {
debugPrint("π presentVerificationFlow called");
final verificationWidget = await createVerificationFlow(
context: context,
apiKey: apiKey,
kycLevel: kycLevel,
firstName: firstName,
lastName: lastName,
uniqueId: uniqueId,
phoneNumber: phoneNumber,
email: email,
ageVerification: ageVerification,
showCompletionView: showCompletionView,
completion: () {
debugPrint("πͺ Completion callback called - popping navigator");
if (Navigator.of(context).canPop()) {
Navigator.of(context).pop();
}
},
onVerificationCompleted: onVerificationCompleted,
onVerificationCancelled: onVerificationCancelled,
onVerificationError: onVerificationError,
);
debugPrint("π± About to push verification widget");
if (context.mounted) {
await Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => verificationWidget,
fullscreenDialog: true,
),
);
debugPrint("π± Navigator.push completed (modal dismissed)");
}
}