create method
Creates a new user.
emailAddress is the email address of the user.
phoneNumber is the phone number of the user.
fullName is the full name of the user.
otpToken is the OTP token for verification.
verificationId is the verification ID.
codePromo is an optional promo code.
Returns the created UserModel instance.
Implementation
Future<ApiResponseModel<UserModel?>> create({
required String emailAddress,
required String phoneNumber,
required String fullName,
required String otpToken,
required String verificationId,
String? codePromo,
}) async {
final url = "$_baseUrl/user/create";
final payload = {
'emailAddress': emailAddress,
'phoneNumber': phoneNumber,
'fullName': fullName,
'otpToken': otpToken,
'verificationId': verificationId,
if (codePromo != null) 'codePromo': codePromo,
};
debugPrint("flutter_mon_sms_pro/user/create/payload: $payload");
final r = await _dio.post(url, data: payload);
debugPrint("flutter_mon_sms_pro/user/create/data: ${r.data}");
final response = ApiResponseModel.fromJson(
r.data,
(data) => UserModel.fromJson(data as Map<String, dynamic>),
);
return response;
}