toJson method

Map<String, dynamic> toJson({
  1. bool enableDeviceParameters = true,
  2. bool enableApplicationParameters = true,
  3. bool enableStackTrace = true,
  4. bool enableCustomParameters = false,
  5. bool enalbeScreen = true,
  6. bool enableScreenRouters = true,
})

Creates json from current instance

Implementation

Map<String, dynamic> toJson({
  bool enableDeviceParameters = true,
  bool enableApplicationParameters = true,
  bool enableStackTrace = true,
  bool enableCustomParameters = false,
  bool enalbeScreen = true,
  bool enableScreenRouters = true,
}) {
  final Map<String, dynamic> json = <String, dynamic>{
    "error": error.toString(),
    "customParameters": customParameters,
    "dateTime": dateTime.toIso8601String(),
    "platformType": describeEnum(platformType),
  };
  if (enableDeviceParameters) {
    json["deviceParameters"] = deviceParameters;
  }
  if (enableApplicationParameters) {
    json["applicationParameters"] = applicationParameters;
  }
  if (enableStackTrace) {
    json["stackTrace"] = stackTrace.toString();
  }
  if (enableCustomParameters) {
    json["customParameters"] = customParameters;
  }
  if (enableScreenRouters) {
    json["screenRouters"] = screenRouters;
  }
  return json;
}