Context.fromJson constructor
Context.fromJson(
- Object? j
Implementation
factory Context.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return Context(
rules: switch (json['rules']) {
null => [],
List<Object?> $1 => [for (final i in $1) ContextRule.fromJson(i)],
_ => throw const FormatException('"rules" is not a list'),
},
);
}