sendOtp method

Future<void> sendOtp(
  1. String phone, {
  2. String? countryCode,
})

Implementation

Future<void> sendOtp(String phone, {String? countryCode}) async {
  final data = await ref.read(authControllerProvider.notifier).sendOtp(phone);

  if (data == null) return;

  state = state.copyWith(
    phone: phone,
    countryCode: countryCode,
    step: FxPhoneAuthStep.enterOtp,
    otpData: data,
  );
}