Capabilities.fromJson constructor

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

Implementation

Capabilities.fromJson(Map<String, Object?> json)
    : mChangePassword = ((v) => v != null
          ? ChangePasswordCapability.fromJson(v as Map<String, Object?>)
          : null)(json['m.change_password']),
      mRoomVersions = ((v) => v != null
          ? RoomVersionsCapability.fromJson(v as Map<String, Object?>)
          : null)(json['m.room_versions']),
      additionalProperties = Map.fromEntries(json.entries
          .where((e) =>
              !['m.change_password', 'm.room_versions'].contains(e.key))
          .map((e) => MapEntry(e.key, e.value as Map<String, Object?>)));