updatePhone method

Future<Account> updatePhone({
  1. required String phone,
  2. required String password,
})

Update Phone

Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the POST /account/verification/phone endpoint to send a confirmation SMS.

Implementation

Future<models.Account> updatePhone(
    {required String phone, required String password}) async {
  const String path = '/account/phone';

  final Map<String, dynamic> params = {
    'phone': phone,
    'password': password,
  };

  final Map<String, String> headers = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.patch,
      path: path, params: params, headers: headers);

  return models.Account.fromMap(res.data);
}