toJson method
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;
}