authenticateUser method

Future<UserModel?> authenticateUser({
  1. dynamic firstName,
  2. dynamic lastName,
  3. dynamic about,
  4. dynamic profileImg,
  5. dynamic token,
  6. dynamic socialMedia,
  7. dynamic partnerId,
})

Implementation

Future<UserModel?> authenticateUser(
    {firstName, lastName, about, profileImg, token, socialMedia, partnerId}) {
  Log(
    logName: 'AuthenticateUser',
    className: 'User',
    methodName: 'authenticateUser',
    type: 'INFO',
    text:
        '{event: Authenticate User, first name: $firstName, last name: $lastName, about: $about, profile image: $profileImg, partner id: $partnerId, ',
  );
  return _httpService
      .authenticateUser(
          firstName: firstName,
          lastName: lastName,
          about: about,
          profileImg: profileImg,
          token: token,
          partnerId: partnerId)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      try {
        var res = json.decode(data.body);
        UserModel userData = UserModel.fromJson(res);
        _user = userData;
        return userData;
      } catch (e) {
        print('error $e');
      }
    }
    return null;
  });
}