Make room type into an enum
This commit is contained in:
parent
fc6ca5b454
commit
e59505bd6e
1 changed files with 7 additions and 1 deletions
|
|
@ -19,13 +19,19 @@ abstract class CreateContent extends Content with _$CreateContent {
|
||||||
@JsonKey(name: "m.federate") @Default(true) bool federated,
|
@JsonKey(name: "m.federate") @Default(true) bool federated,
|
||||||
|
|
||||||
@Default("1") String roomVersion,
|
@Default("1") String roomVersion,
|
||||||
String? type,
|
@JsonKey(unknownEnumValue: RoomType.room) RoomType? type,
|
||||||
}) = _CreateContent;
|
}) = _CreateContent;
|
||||||
|
|
||||||
factory CreateContent.fromJson(Map<String, Object?> json) =>
|
factory CreateContent.fromJson(Map<String, Object?> json) =>
|
||||||
_$CreateContentFromJson(json);
|
_$CreateContentFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum RoomType {
|
||||||
|
room,
|
||||||
|
@JsonValue("m.space")
|
||||||
|
space,
|
||||||
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class PreviousRoom with _$PreviousRoom {
|
abstract class PreviousRoom with _$PreviousRoom {
|
||||||
const factory PreviousRoom({required String roomId}) = _PreviousRoom;
|
const factory PreviousRoom({required String roomId}) = _PreviousRoom;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue