Implement Scanner-View
This commit is contained in:
@@ -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>),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user