1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-10-23 06:53:23 +00:00
comunicmobile/lib/lists/conversations_list.dart

31 lines
743 B
Dart
Raw Normal View History

import 'dart:collection';
import 'package:comunic/lists/users_list.dart';
import 'package:comunic/models/conversation.dart';
/// Conversations list
///
/// @author Pierre HUBERT
class ConversationsList extends ListBase<Conversation> {
final List<Conversation> _list = List();
UsersList users;
set length(l) => _list.length = l;
2021-03-10 16:54:41 +00:00
int get length => _list.length;
@override
Conversation operator [](int index) => _list[index];
@override
void operator []=(int index, Conversation value) => _list[index] = value;
/// Get the entire lists of users ID in this list
2021-03-10 16:54:41 +00:00
Set<int> get allUsersID {
final Set<int> list = Set();
forEach((c) => c.members.forEach((member) => list.add(member.userID)));
return list;
}
}