1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-29 08:16:28 +00:00
comunicmobile/lib/lists/comments_list.dart

27 lines
585 B
Dart
Raw Normal View History

2019-05-16 12:52:22 +00:00
import 'dart:collection';
import 'package:comunic/models/comment.dart';
/// Comments list
///
/// Contains the list of comments for a post
///
/// @author Pierre HUBERT
class CommentsList extends ListBase<Comment> {
2021-03-13 14:14:54 +00:00
List<Comment> _list = [];
2019-05-16 12:52:22 +00:00
int get length => _list.length;
set length(int l) => _list.length = l;
@override
Comment operator [](int index) => _list[index];
@override
void operator []=(int index, Comment value) => _list[index] = value;
/// Get the list of users in this comments, as a set
Set<int> get usersID => map((f) => f.userID).toSet();
}