forked from Henry-Hiles/nexus
wip
This commit is contained in:
parent
5424dda62a
commit
27fba2cdb5
11 changed files with 228 additions and 19 deletions
27
lib/models/room_metadata.dart
Normal file
27
lib/models/room_metadata.dart
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/content_uri.dart";
|
||||
import "package:nexus/models/epoch_date_time_converter.dart";
|
||||
import "package:nexus/models/lazy_load_summary.dart";
|
||||
part "room_metadata.freezed.dart";
|
||||
part "room_metadata.g.dart";
|
||||
|
||||
@freezed
|
||||
abstract class RoomMetadata with _$RoomMetadata {
|
||||
const factory RoomMetadata({
|
||||
@JsonKey(name: "room_id") required String id,
|
||||
// required CreateEventContent creationContent,
|
||||
// required TombstoneEventContent tombstoneEventContent,
|
||||
String? name,
|
||||
ContentUri? avatar,
|
||||
String? topic,
|
||||
String? canonicalAlias,
|
||||
LazyLoadSummary? lazyLoadSummary,
|
||||
required bool hasMemberList,
|
||||
@JsonKey(name: "preview_event_rowid") required String previewEventRowID,
|
||||
@EpochDateTimeConverter() required DateTime sortingTimestamp,
|
||||
@Default(false) bool markedUnread,
|
||||
}) = _RoomMetadata;
|
||||
|
||||
factory RoomMetadata.fromJson(Map<String, Object?> json) =>
|
||||
_$RoomMetadataFromJson(json);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue