authenticateUser method
Future<UserModel?>
authenticateUser({
- dynamic firstName,
- dynamic lastName,
- dynamic about,
- dynamic profileImg,
- dynamic token,
- dynamic socialMedia,
- 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;
});
}