Implement Scanner-View

This commit is contained in:
2025-04-13 00:17:06 +02:00
parent c0b8a8a3f4
commit 95353735b0
19 changed files with 961 additions and 179 deletions

View File

@@ -71,13 +71,15 @@ class Channel extends HiveObject implements FieldDebuggable {
];
}
ChannelPreview toPreview() {
ChannelPreview toPreview(Subscription? sub) {
return ChannelPreview(
channelID: this.channelID,
ownerUserID: this.ownerUserID,
internalName: this.internalName,
displayName: this.displayName,
descriptionName: this.descriptionName,
messagesSent: this.messagesSent,
subscription: sub,
);
}
}
@@ -109,6 +111,8 @@ class ChannelPreview {
final String internalName;
final String displayName;
final String? descriptionName;
final int messagesSent;
final Subscription? subscription;
const ChannelPreview({
required this.channelID,
@@ -116,6 +120,8 @@ class ChannelPreview {
required this.internalName,
required this.displayName,
required this.descriptionName,
required this.messagesSent,
required this.subscription,
});
factory ChannelPreview.fromJson(Map<String, dynamic> json) {
@@ -125,6 +131,8 @@ class ChannelPreview {
internalName: json['internal_name'] as String,
displayName: json['display_name'] as String,
descriptionName: json['description_name'] as String?,
messagesSent: json['messages_sent'] as int,
subscription: json['subscription'] == null ? null : Subscription.fromJson(json['subscription'] as Map<String, dynamic>),
);
}
}