updateProfile static method
dynamic
updateProfile({})
Implementation
static updateProfile({
required String subscribername,
String? dob,
required String profilePin,
String gender = "",
String picture = "",
}) async {
String url = "${AppUrls.baseUrlVSMS}/subscriberv2/v1/subscriber";
dynamic body;
if (picture.isNotEmpty) {
body = {
"subscribername": subscribername,
"profilepin": profilePin,
"dob": dob,
"gender": gender.isEmpty ? null : gender,
"picture": picture,
};
} else {
body = {
"subscribername": subscribername,
"profilepin": profilePin,
"dob": dob,
"gender": gender.isEmpty ? null : gender,
};
}
final response = await _dio!.put(url, data: body);
if (response.statusCode == 200) {
return response.data;
} else {
throw Exception("failed to update");
}
}