resendCode method

Future<Result<AuthSentCodeBase>> resendCode({
  1. required String phoneNumber,
  2. required String phoneCodeHash,
  3. String? reason,
})

Resend Code.

ID: cae47523.

Implementation

Future<Result<AuthSentCodeBase>> resendCode({
  required String phoneNumber,
  required String phoneCodeHash,
  String? reason,
}) async {
  // Preparing the request.
  final request = AuthResendCode(
    phoneNumber: phoneNumber,
    phoneCodeHash: phoneCodeHash,
    reason: reason,
  );

  // Invoke and wait for response.
  final response = await _c.invoke(request);

  // Return the result.
  return response._to<AuthSentCodeBase>();
}