2020-05-08 13:40:13 +00:00
|
|
|
import 'package:comunic/lists/abstract_list.dart';
|
|
|
|
import 'package:comunic/models/unread_conversation.dart';
|
|
|
|
|
|
|
|
/// List of unread conversations
|
|
|
|
///
|
|
|
|
/// @author Pierre Hubert
|
|
|
|
|
|
|
|
class UnreadConversationsList extends AbstractList<UnreadConversation> {
|
|
|
|
/// Get the ID of the users included in this list
|
2021-03-10 16:54:41 +00:00
|
|
|
Set<int> get usersID {
|
2021-03-11 17:50:36 +00:00
|
|
|
final set = Set<int>();
|
2021-04-25 14:12:36 +00:00
|
|
|
forEach((element) {
|
|
|
|
set.addAll(element.conv.membersID);
|
|
|
|
set.addAll(element.message.usersID);
|
|
|
|
});
|
|
|
|
return set;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Get the ID of the groups references ind this list
|
|
|
|
Set<int> get groupsID {
|
|
|
|
final set = Set<int>();
|
|
|
|
forEach((element) {
|
|
|
|
if (element.conv.isGroupConversation) set.add(element.conv.groupID);
|
|
|
|
});
|
2021-03-10 16:54:41 +00:00
|
|
|
return set;
|
|
|
|
}
|
2020-05-08 13:40:13 +00:00
|
|
|
}
|