resend method
Implementation
Future<AuthyoResult> resend(AuthwayEnum channel) async {
errorMessage = null;
infoMessage = null;
_setLoading(true);
final res = await _service.requestOtp(
to: to,
authWay: channel,
otpLength: otpLength,
expiry: resendTimerSeconds > 0 ? resendTimerSeconds : null,
);
if (_disposed) return res;
if (res.error != null) {
errorMessage = res.error!.message;
} else {
_adoptSendResult(res);
if (maskId == null) {
errorMessage = 'Error in sending OTP. Please check entered details.';
} else {
infoMessage = 'OTP sent successfully';
otp = '';
_restartTimer();
}
}
_setLoading(false);
return res;
}