forked from Nexus/nexus
migrate Content classes to primary constructors
The Riverpod bug preventing us from doing this has been fixed.
This commit is contained in:
parent
853116ab2f
commit
dd01ad9d74
1 changed files with 120 additions and 162 deletions
|
|
@ -4,15 +4,13 @@ import "package:nexus/models/content/content.dart";
|
|||
part "server_acl.freezed.dart";
|
||||
part "server_acl.g.dart";
|
||||
|
||||
@freezed
|
||||
sealed class ServerACLContent extends Content with _$ServerACLContent {
|
||||
ServerACLContent._();
|
||||
factory ServerACLContent({
|
||||
@Default(IList.empty()) IList<String> allow,
|
||||
@Default(IList.empty()) IList<String> deny,
|
||||
@Default(true) allowIpLiterals,
|
||||
}) = _ServerACLContent;
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const ServerACLContent({
|
||||
final IList<String> allow = const .empty(),
|
||||
final IList<String> deny = const .empty(),
|
||||
final bool allowIpLiterals = true,
|
||||
}) extends Content with _$ServerACLContent {
|
||||
factory ServerACLContent.fromJson(Map<String, Object?> json) =>
|
||||
_$ServerACLContentFromJson(json);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue