SentryApp.fromJson constructor

SentryApp.fromJson(
  1. Map<String, dynamic> data
)

Deserializes a SentryApp from JSON Map.

Implementation

factory SentryApp.fromJson(Map<String, dynamic> data) {
  final json = AccessAwareMap(data);
  final viewNamesJson = json['view_names'] as List<dynamic>?;
  return SentryApp(
    name: json['app_name'],
    version: json['app_version'],
    identifier: json['app_identifier'],
    build: json['app_build'],
    buildType: json['build_type'],
    startTime: json['app_start_time'] != null
        ? DateTime.tryParse(json['app_start_time'])
        : null,
    deviceAppHash: json['device_app_hash'],
    appMemory: json['app_memory'],
    inForeground: json['in_foreground'],
    viewNames: viewNamesJson?.map((e) => e as String).toList(),
    textScale: json['text_scale'],
    unknown: json.notAccessed(),
  );
}