DataItemView.fromJson constructor

DataItemView.fromJson(
  1. Object? j
)

Implementation

factory DataItemView.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return DataItemView(
    dataItem: switch (json['dataItem']) {
      null => null,
      Object $1 => DataItem.fromJson($1),
    },
    annotations: switch (json['annotations']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Annotation.fromJson(i)],
      _ => throw const FormatException('"annotations" is not a list'),
    },
    hasTruncatedAnnotations: switch (json['hasTruncatedAnnotations']) {
      null => false,
      Object $1 => decodeBool($1),
    },
  );
}