DiscoveryInformation.fromJson constructor

DiscoveryInformation.fromJson(
  1. Map<String, Object?> json
)

Implementation

DiscoveryInformation.fromJson(Map<String, Object?> json)
    : mHomeserver = HomeserverInformation.fromJson(
          json['m.homeserver'] as Map<String, Object?>),
      mIdentityServer = ((v) => v != null
          ? IdentityServerInformation.fromJson(v as Map<String, Object?>)
          : null)(json['m.identity_server']),
      additionalProperties = Map.fromEntries(json.entries
          .where(
              (e) => !['m.homeserver', 'm.identity_server'].contains(e.key))
          .map((e) => MapEntry(e.key, e.value as Map<String, Object?>)));