authenticateOtp static method Null safety

Future<OtpChallengeResponse> authenticateOtp(
  1. String url,
  2. String email
)

Initiates authentication using an OTP, which will be sent to the provided email address.

url The authentication URL of the current transaction. email The email address where the OTP will be sent. Returns a OtpChallengeResponse or throws an Exception

Implementation

static Future<OtpChallengeResponse> authenticateOtp(
    String url, String email) async {
  final Map<String, dynamic>? otpChallengeResponse =
      await _channel.invokeMapMethod('authenticateOtp', {
    'url': url,
    'email': email,
  });

  try {
    return OtpChallengeResponse(
      url: otpChallengeResponse?["url"],
    );
  } on Exception {
    rethrow;
  }
}