changePassword method

Future<void> changePassword(
  1. String oldPassword,
  2. String password, {
  3. required void onSuccess(),
  4. required void onError(
    1. 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);
  });
}