Claim.fromJson constructor

Claim.fromJson(
  1. Object? j
)

Implementation

factory Claim.fromJson(Object? j) {
  final json = j as Map<String, Object?>;
  return Claim(
    startIndex: switch (json['startIndex']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    endIndex: switch (json['endIndex']) {
      null => null,
      Object $1 => decodeInt($1),
    },
    factIndexes: switch (json['factIndexes']) {
      null => [],
      List<Object?> $1 => [for (final i in $1) decodeInt(i)],
      _ => throw const FormatException('"factIndexes" is not a list'),
    },
    score: switch (json['score']) {
      null => null,
      Object $1 => decodeDouble($1),
    },
  );
}