2019-05-01 15:52:41 +00:00
|
|
|
import 'dart:collection';
|
|
|
|
|
|
|
|
import 'package:comunic/models/friend.dart';
|
|
|
|
|
|
|
|
/// List of friends of the user
|
|
|
|
///
|
|
|
|
/// @author Pierre HUBERT
|
|
|
|
|
|
|
|
class FriendsList extends ListBase<Friend> {
|
2021-03-13 14:14:54 +00:00
|
|
|
List<Friend> _list = [];
|
2019-05-01 15:52:41 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
/// Get the ID of all the friends of the current user
|
|
|
|
List<int> get usersId => map((f) => f.id).toList();
|
|
|
|
}
|