getUserByPhoneNumber method

Future<UserRecord> getUserByPhoneNumber(
  1. String phoneNumber
)

Looks up the user identified by the provided phone number and returns a future that is fulfilled with a user record for the given user if that user is found.

Implementation

Future<UserRecord> getUserByPhoneNumber(String phoneNumber) async {
  var response =
      await _authRequestHandler.getAccountInfoByPhoneNumber(phoneNumber);
  // Returns the user record populated with server response.
  return UserRecord.fromJson(response['users'][0]);
}