PreviewForUrl.fromJson constructor

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

Implementation

PreviewForUrl.fromJson(Map<String, Object?> json)
  : matrixImageSize = ((v) =>
        v != null ? v as int : null)(json['matrix:image:size']),
    ogImage = ((v) =>
        v != null ? Uri.parse(v as String) : null)(json['og:image']),
    additionalProperties = Map.fromEntries(
      json.entries
          .where((e) => !['matrix:image:size', 'og:image'].contains(e.key))
          .map((e) => MapEntry(e.key, e.value as Object?)),
    );