2019-06-10 07:47:02 +00:00
|
|
|
import 'dart:collection';
|
|
|
|
|
|
|
|
import 'package:comunic/models/group.dart';
|
|
|
|
|
|
|
|
/// Groups list
|
|
|
|
///
|
|
|
|
/// @author Pierre HUBERT
|
|
|
|
|
2022-03-10 18:39:57 +00:00
|
|
|
class GroupsList extends MapBase<int?, Group> {
|
|
|
|
final Map<int?, Group?> _groups = Map();
|
2019-06-10 07:47:02 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-10 18:39:57 +00:00
|
|
|
Group? operator [](Object? key) => _groups[key];
|
2019-06-10 07:47:02 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-10 18:39:57 +00:00
|
|
|
void operator []=(int? key, Group? value) => _groups[key] = value;
|
2019-06-10 07:47:02 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
void clear() => _groups.clear();
|
|
|
|
|
|
|
|
@override
|
2022-03-10 18:39:57 +00:00
|
|
|
Iterable<int?> get keys => _groups.keys;
|
2019-06-10 07:47:02 +00:00
|
|
|
|
|
|
|
@override
|
2022-03-10 18:39:57 +00:00
|
|
|
Group? remove(Object? key) => _groups.remove(key);
|
2019-06-10 07:47:02 +00:00
|
|
|
|
2022-03-10 18:39:57 +00:00
|
|
|
Group? getGroup(int? id) => this[id];
|
2019-06-10 07:47:02 +00:00
|
|
|
}
|