NamedSet.fromJson constructor

NamedSet.fromJson(
  1. Object? j
)

Implementation

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