updateBug method

  1. @override
Future<bool> updateBug(
  1. Map<String, dynamic> param,
  2. List<File> files,
  3. List<File>? newSelectedMedia,
  4. List<String>? removedMediaId,
)
override

Implementation

@override
Future<bool> updateBug(Map<String, dynamic> param,List<File> files, List<File>? newSelectedMedia, List<String>? removedMediaId) {
  return networkAPI
      .updateBug(
      title: param["title"],
      reportId: param["reportId"],
      description: param["description"],
      type: param["type"],
      priority: param["priority"],
      source: param["source"]??"android",
      reporterId: param["reporterId"],
      appId: packageDetails?.appName ?? "",
      device: param["device"],
      os: param["os"],
      screenResolution:  param["screenResolution"],
      networkType: param["networkType"],
      batteryLevel: param["batteryLevel"],
      appIdCall: appIdCall!,
      reportingTokenCall: reportingTokenCall!,
      mediaFiles: newSelectedMedia,
      removedMediaId: removedMediaId,
      crashLog: null)
      .then((response) {
    if (response.statusCode == 201 || response.statusCode == 200) {
      debugPrint('Bug reported successfully!');
      return true;
    } else {
      debugPrint('An error occurred while reporting bug!');
      debugPrint(response.statusCode as String?);
      return false;
    }
  }).catchError((error) {
    debugPrint('An error occurred while reporting bug!');
    return false;
  });
}