initiateTokenVerification method

Future<Widget> initiateTokenVerification({
  1. required String token,
  2. required dynamic onClose(
    1. VerificationData?
    ),
})

This method initializes the webview token verification process

Implementation

Future<Widget> initiateTokenVerification({
  required String token,
  required Function(VerificationData?) onClose,
}) async {
  if (token == '' || token.isEmpty) {
    throw MetricSDKError('Please input a valid token');
  }

  final String url = 'https://app.metric.africa?token=$token&channel=iframe';

  return MetricWebview(
    token: token,
    url: url,
    onClose: onClose,
  );
}