Explanation.fromJson constructor

Explanation.fromJson(
  1. Object? j
)

Implementation

factory Explanation.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Explanation(
    attributions: switch (json['attributions']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Attribution.fromJson(i)],
      _ => throw const FormatException('"attributions" is not a list'),
    },
    neighbors: switch (json['neighbors']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) Neighbor.fromJson(i)],
      _ => throw const FormatException('"neighbors" is not a list'),
    },
  );
}