reportBug method

  1. @override
Future<bool> reportBug(
  1. Map<String, dynamic> param,
  2. List<File> files
)
override

Implementation

@override
Future<bool> reportBug(Map<String, dynamic> param,List<File> files) {
  return networkAPI
      .reportBug(
          title: param["title"],
          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: files,
          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;
  });
}