1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Display the list of comments

This commit is contained in:
2019-05-16 14:52:22 +02:00
parent be53a73d9f
commit 28de22f427
8 changed files with 198 additions and 10 deletions

View File

@ -0,0 +1,26 @@
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> {
List<Comment> _list = List();
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();
}

View File

@ -31,6 +31,9 @@ class PostsList extends ListBase<Post> {
if(p.userPageID != null && p.userPageID > 0)
set.add(p.userPageID);
if(p.comments != null)
set.addAll(p.comments.usersID);
});
return set;