forked from Nexus/nexus
Remove flutter chat (#26)
Had to squash merge manually as Forgejo was erroring
This commit is contained in:
parent
bd1d5ea745
commit
16cf126df4
111 changed files with 3162 additions and 2366 deletions
41
lib/models/content/create.dart
Normal file
41
lib/models/content/create.dart
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/content/content.dart";
|
||||
part "create.freezed.dart";
|
||||
part "create.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class CreateContent extends Content with _$CreateContent {
|
||||
CreateContent._();
|
||||
factory CreateContent({
|
||||
@JsonKey(name: "creator") String? creatorId,
|
||||
|
||||
@JsonKey(name: "additional_creators")
|
||||
@Default(IList.empty())
|
||||
IList<String> additionalCreatorIds,
|
||||
|
||||
PreviousRoom? predecessor,
|
||||
|
||||
@JsonKey(name: "m.federate") @Default(true) bool federated,
|
||||
|
||||
@Default("1") String roomVersion,
|
||||
@JsonKey(unknownEnumValue: RoomType.room) RoomType? type,
|
||||
}) = _CreateContent;
|
||||
|
||||
factory CreateContent.fromJson(Map<String, Object?> json) =>
|
||||
_$CreateContentFromJson(json);
|
||||
}
|
||||
|
||||
enum RoomType {
|
||||
room,
|
||||
@JsonValue("m.space")
|
||||
space,
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PreviousRoom with _$PreviousRoom {
|
||||
const factory PreviousRoom({required String roomId}) = _PreviousRoom;
|
||||
|
||||
factory PreviousRoom.fromJson(Map<String, Object?> json) =>
|
||||
_$PreviousRoomFromJson(json);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue