changePhone method

Future<Result<UserBase>> changePhone({
  1. required String phoneNumber,
  2. required String phoneCodeHash,
  3. required String phoneCode,
})

Change Phone.

ID: 70c32edb.

Implementation

Future<Result<UserBase>> changePhone({
  required String phoneNumber,
  required String phoneCodeHash,
  required String phoneCode,
}) async {
  // Preparing the request.
  final request = AccountChangePhone(
    phoneNumber: phoneNumber,
    phoneCodeHash: phoneCodeHash,
    phoneCode: phoneCode,
  );

  // Invoke and wait for response.
  final response = await _c.invoke(request);

  // Return the result.
  return response._to<UserBase>();
}