Metadata.fromJson constructor

Metadata.fromJson(
  1. Object? j
)

Implementation

factory Metadata.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Metadata(
    fingerprint: switch (json['fingerprint']) {
      null => null,
      Object $1 => decodeString($1),
    },
    items: switch (json['items']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Items.fromJson(i)],
      _ => throw const FormatException('"items" is not a list'),
    },
    kind: switch (json['kind']) {
      null => null,
      Object $1 => decodeString($1),
    },
  );
}