I am trying to upload user information (imagePath
, firstName
, lastName
) to a server with the help of a http request.
Future<UserModel> userSignUp({
String firstName,
String lastName,
File imagePath,
}) async {
Map<String, dynamic> data = {
"FNAME": firstName,
"LNAME": lastName,
"image": imagePath
};
var response = await _helper.post(
Services.userSignUp,
isSecure: false,
headers: {
"Content-Type": "application/json",
},
body: json.encode(data),
);
return UserModel.fromJson(response);
}