migrate Content classes to primary constructors

The Riverpod bug preventing us from doing this has been fixed.
This commit is contained in:
Henry Hiles 2026-10-23 20:44:29 -04:00
commit dd01ad9d74
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -5,14 +5,12 @@ import "package:nexus/models/join_rule.dart";
part "join_rules.freezed.dart";
part "join_rules.g.dart";
@freezed
sealed class JoinRulesContent extends Content with _$JoinRulesContent {
JoinRulesContent._();
factory JoinRulesContent({
@JsonKey(unknownEnumValue: JoinRule.unknown) required JoinRule joinRule,
@Default(ISet.empty()) ISet<AllowCondition> allow,
}) = _JoinRulesContent;
@Freezed(toJson: false, fromJson: false)
@JsonSerializable()
class const JoinRulesContent({
@JsonKey(unknownEnumValue: JoinRule.unknown) required final JoinRule joinRule,
final ISet<AllowCondition> allow = const .empty(),
}) extends Content with _$JoinRulesContent {
factory JoinRulesContent.fromJson(Map<String, Object?> json) =>
_$JoinRulesContentFromJson(json);
}