SentryUser.fromJson constructor

SentryUser.fromJson(
  1. Map<String, dynamic> jsonData
)

Deserializes a SentryUser from JSON Map.

Implementation

factory SentryUser.fromJson(Map<String, dynamic> jsonData) {
  final json = AccessAwareMap(jsonData);

  var extras = json['extras'];
  if (extras != null) {
    extras = Map<String, dynamic>.from(extras);
  }

  var data = json['data'];
  if (data != null) {
    data = Map<String, dynamic>.from(data);
  }

  SentryGeo? geo;
  final geoJson = json['geo'];
  if (geoJson != null) {
    geo = SentryGeo.fromJson(Map<String, dynamic>.from(geoJson));
  }
  return SentryUser(
    id: json['id'],
    username: json['username'],
    email: json['email'],
    ipAddress: json['ip_address'],
    segment: json['segment'],
    data: data,
    geo: geo,
    name: json['name'],
    // ignore: deprecated_member_use_from_same_package
    extras: extras,
    unknown: json.notAccessed(),
  );
}