Remove flutter chat #26
1 changed files with 7 additions and 1 deletions
Make room type into an enum
commit
e59505bd6e
|
|
@ -19,13 +19,19 @@ abstract class CreateContent extends Content with _$CreateContent {
|
|||
@JsonKey(name: "m.federate") @Default(true) bool federated,
|
||||
|
||||
@Default("1") String roomVersion,
|
||||
String? type,
|
||||
@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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue