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,11 +4,11 @@ import "package:nexus/models/info/image.dart";
|
|||
part "avatar.freezed.dart";
|
||||
part "avatar.g.dart";
|
||||
|
||||
@freezed
|
||||
sealed class AvatarContent extends Content with _$AvatarContent {
|
||||
AvatarContent._();
|
||||
factory AvatarContent({ImageInfo? info, Uri? url}) = _AvatarContent;
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const AvatarContent({final ImageInfo? info, final Uri? url})
|
||||
extends Content
|
||||
with _$AvatarContent {
|
||||
factory AvatarContent.fromJson(Map<String, Object?> json) =>
|
||||
_$AvatarContentFromJson(json);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue