toJson method
Creates json from current instance
Implementation
Map<String, dynamic> toJson({
bool enableDeviceParameters = true,
bool enableApplicationParameters = true,
bool enableStackTrace = true,
bool enableCustomParameters = false,
}) {
final json = <String, dynamic>{
'error': error.toString(),
'customParameters': customParameters,
'dateTime': dateTime.toIso8601String(),
'platformType': platformType.name,
};
if (enableDeviceParameters) {
json['deviceParameters'] = deviceParameters;
}
if (enableApplicationParameters) {
json['applicationParameters'] = applicationParameters;
}
if (enableStackTrace) {
json['stackTrace'] = stackTrace.toString();
}
if (enableCustomParameters) {
json['customParameters'] = customParameters;
}
return json;
}