resendVerificationCode method

  1. @override
Future<void> resendVerificationCode()
override

Resends the verification code based on the current screen.

Define the resend code according to the current screen (registration or password reset verification). Throws an error if the current screen is not a verification screen.

Implementation

@override
Future<void> resendVerificationCode() async {
  await switch (currentScreen) {
    EmailFlowScreen.verifyRegistration => startRegistration(),
    EmailFlowScreen.verifyPasswordReset => startPasswordReset(),
    _ => throw StateError('Cannot resend code on screen: $currentScreen'),
  };
}