signup method
Future<LoginUser?>
signup(
- String username,
- String countryCode,
- String contact,
- ContactType contactType,
- String verifyCode,
- String password, {
- HandleError? onError,
override
Implementation
@override
Future<LoginUser?> signup(
String username,
String countryCode,
String contact,
ContactType contactType,
String verifyCode,
String password, {
HandleError? onError,
}) async {
var res = await helper.post(
'/signup',
data: {
"name": username,
"contact": contact,
"country_code": countryCode,
"contact_type": contactTypes[contactType],
"verify_code": verifyCode,
"password": password,
},
showError: onError,
);
if (res == false) {
return null;
}
return LoginUser(
token: res['data']['token'],
user: User.fromJson(res['data']['user']),
);
}