updateLogo method

Future<ApiResponseModel<UserModel?>> updateLogo({
})

Updates the user's logo/profile picture.

logo is the base64 encoded image or URL. Returns the updated UserModel instance.

Implementation

Future<ApiResponseModel<UserModel?>> updateLogo({
  required String logo,
}) async {
  final url = "$_baseUrl/user/update/logo";

  final payload = {
    'apiKey': _apiKey,
    'logo': logo,
  };

  debugPrint("flutter_mon_sms_pro/user/update/logo/payload: updating logo");

  final r = await _dio.post(url, data: payload);

  debugPrint("flutter_mon_sms_pro/user/update/logo/data: ${r.data}");

  final response = ApiResponseModel.fromJson(
    r.data,
    (data) => UserModel.fromJson(data as Map<String, dynamic>),
  );

  return response;
}