BugsnagEvent.fromJson constructor
BugsnagEvent.fromJson(
- Map<String, dynamic> json
)
Implementation
BugsnagEvent.fromJson(Map<String, dynamic> json)
: apiKey = json['apiKey'] as String?,
errors = (json['exceptions'] as List?)
?.cast<Map>()
.map((m) => BugsnagError.fromJson(m.cast()))
.toList(growable: true) ??
[],
threads = (json['threads'] as List?)
?.cast<Map>()
.map((m) => BugsnagThread.fromJson(m.cast()))
.toList(growable: true) ??
[],
breadcrumbs = (json['breadcrumbs'] as List?)
?.cast<Map>()
.map((m) => BugsnagBreadcrumb.fromJson(m.cast()))
.toList(growable: true) ??
[],
context = json['context'] as String?,
groupingHash = json['groupingHash'] as String?,
_unhandled = json['unhandled'] == true,
_originalUnhandled = json['unhandled'] == true,
severity = BugsnagSeverity.values.findByName(json['severity']),
_severityReason = _SeverityReason.fromJson(json['severityReason']),
_projectPackages =
(json['projectPackages'] as List?)?.toList(growable: true).cast() ??
[],
_session = json
.safeGet<Map>('session')
?.let((session) => _Session.fromJson(session.cast())),
_user = BugsnagUser.fromJson(json['user']),
device = BugsnagDeviceWithState.fromJson(json['device']),
app = BugsnagAppWithState.fromJson(json['app']),
_featureFlags = BugsnagFeatureFlags.fromJson(
json['featureFlags'].cast<Map<String, dynamic>>()),
_metadata = json
.safeGet<Map>('metaData')
?.let((m) => BugsnagMetadata.fromJson(m.cast())) ??
BugsnagMetadata();