This commit is contained in:
Juan Felipe Duarte
2023-04-04 09:18:33 -05:00
parent 9656a85090
commit 50737e03dd
7 changed files with 304 additions and 155 deletions
@@ -132,4 +132,15 @@ class AuthenticationRepository extends GetxController {
}
return city;
}
Future<void> updatePhoneNumber(String verificationId, String smsCode) async {
try {
PhoneAuthCredential credential = PhoneAuthProvider.credential(
verificationId: verificationId, smsCode: smsCode);
await FirebaseAuth.instance.currentUser!.updatePhoneNumber(credential);
print("Phone number updated successfully");
} catch (e) {
print("Error updating phone number: $e");
}
}
}