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
|
|
@ -3,11 +3,11 @@ import "package:nexus/models/content/content.dart";
|
|||
part "name.freezed.dart";
|
||||
part "name.g.dart";
|
||||
|
||||
@freezed
|
||||
sealed class NameContent extends Content with _$NameContent {
|
||||
NameContent._();
|
||||
factory NameContent({required String name}) = _NameContent;
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const NameContent({required final String name})
|
||||
extends Content
|
||||
with _$NameContent {
|
||||
factory NameContent.fromJson(Map<String, Object?> json) =>
|
||||
_$NameContentFromJson(json);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue