changePassword method
Future<void>
changePassword(
- String oldPassword,
- String password, {
- required void onSuccess(),
- required void onError(
- SyneriseError error
This function changes the user's password by calling a private method with the old and new passwords as parameters.
Args: oldPassword (String): The old password is a string parameter that represents the user's current password. It is used to verify the user's identity before allowing them to change their password. password (String): The new password that the user wants to set.
Implementation
Future<void> changePassword(String oldPassword, String password,
{required void Function() onSuccess,
required void Function(SyneriseError error) onError}) async {
SyneriseResult<void> result =
await _methods.changePassword(oldPassword, password);
result.onSuccess((result) {
onSuccess();
}).onError((error) {
onError(error);
});
}