ProfileInformation.fromJson constructor
Implementation
ProfileInformation.fromJson(Map<String, Object?> json)
: avatarUrl = ((v) => v != null
? ((v as String).startsWith("mxc://")
? Uri.parse(v as String)
: throw Exception("Uri not an mxc URI"))
: null)(json['avatar_url']),
displayname = ((v) =>
v != null ? v as String : null)(json['displayname']),
mTz = ((v) => v != null ? v as String : null)(json['m.tz']),
additionalProperties = Map.fromEntries(
json.entries
.where(
(e) => !['avatar_url', 'displayname', 'm.tz'].contains(e.key),
)
.map((e) => MapEntry(e.key, e.value as Object?)),
);