mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 12:14:11 +00:00 
			
		
		
		
	Continue to fix issues
This commit is contained in:
		@@ -1,5 +1,4 @@
 | 
			
		||||
import 'dart:collection';
 | 
			
		||||
 | 
			
		||||
import 'package:comunic/lists/abstract_list.dart';
 | 
			
		||||
import 'package:comunic/models/comment.dart';
 | 
			
		||||
 | 
			
		||||
/// Comments list
 | 
			
		||||
@@ -8,19 +7,7 @@ import 'package:comunic/models/comment.dart';
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre HUBERT
 | 
			
		||||
 | 
			
		||||
class CommentsList extends ListBase<Comment> {
 | 
			
		||||
  List<Comment> _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;
 | 
			
		||||
 | 
			
		||||
class CommentsList extends AbstractList<Comment> {
 | 
			
		||||
  /// Get the list of users in this comments, as a set
 | 
			
		||||
  Set<int> get usersID => map((f) => f.userID).toSet();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,24 +1,11 @@
 | 
			
		||||
import 'dart:collection';
 | 
			
		||||
 | 
			
		||||
import 'package:comunic/lists/abstract_list.dart';
 | 
			
		||||
import 'package:comunic/models/friend.dart';
 | 
			
		||||
 | 
			
		||||
/// List of friends of the user
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre HUBERT
 | 
			
		||||
 | 
			
		||||
class FriendsList extends ListBase<Friend> {
 | 
			
		||||
  List<Friend> _list = [];
 | 
			
		||||
 | 
			
		||||
  int get length => _list.length;
 | 
			
		||||
 | 
			
		||||
  set length(int length) => _list.length = length;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Friend operator [](int index) => _list[index];
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void operator []=(int index, Friend value) => _list[index] = value;
 | 
			
		||||
 | 
			
		||||
class FriendsList extends AbstractList<Friend> {
 | 
			
		||||
  /// Get the ID of all the friends of the current user
 | 
			
		||||
  List<int> get usersId => map((f) => f.id).toList();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
import 'dart:collection';
 | 
			
		||||
 | 
			
		||||
import 'package:comunic/lists/abstract_list.dart';
 | 
			
		||||
import 'package:comunic/models/post.dart';
 | 
			
		||||
 | 
			
		||||
/// Posts List
 | 
			
		||||
@@ -8,19 +7,7 @@ import 'package:comunic/models/post.dart';
 | 
			
		||||
///
 | 
			
		||||
/// @author Pierre HUBERT
 | 
			
		||||
 | 
			
		||||
class PostsList extends ListBase<Post> {
 | 
			
		||||
  List<Post> _list = [];
 | 
			
		||||
 | 
			
		||||
  int get length => _list.length;
 | 
			
		||||
 | 
			
		||||
  set length(int l) => _list.length = l;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Post operator [](int index) => _list[index];
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void operator []=(int index, Post value) => _list[index] = value;
 | 
			
		||||
 | 
			
		||||
class PostsList extends AbstractList<Post> {
 | 
			
		||||
  // Get the list of users ID in this set
 | 
			
		||||
  Set<int?> get usersID {
 | 
			
		||||
    Set<int?> set = Set();
 | 
			
		||||
@@ -49,8 +36,7 @@ class PostsList extends ListBase<Post> {
 | 
			
		||||
 | 
			
		||||
  /// Get the ID of the oldest post of this list. Returns 0 if the list is empty
 | 
			
		||||
  int get oldestID {
 | 
			
		||||
    if(isEmpty)
 | 
			
		||||
      return 0;
 | 
			
		||||
    if (isEmpty) return 0;
 | 
			
		||||
 | 
			
		||||
    return this.elementAt(length - 1).id;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
@@ -41,12 +41,7 @@ class PostsListWidget extends StatefulWidget {
 | 
			
		||||
    this.getOlder,
 | 
			
		||||
    this.topWidgets,
 | 
			
		||||
    this.disablePullToRefresh = false,
 | 
			
		||||
  })  : assert(getPostsList != null),
 | 
			
		||||
        assert(showPostsTarget != null),
 | 
			
		||||
        assert(buildListView != null),
 | 
			
		||||
        assert(userNamesClickable != null),
 | 
			
		||||
        assert(disablePullToRefresh != null),
 | 
			
		||||
        super(key: key);
 | 
			
		||||
  }) : super(key: key);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  State<StatefulWidget> createState() => PostsListWidgetState();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user