import 'package:comunic/helpers/serialization/base_serialization_helper.dart'; import 'package:comunic/models/user.dart'; /// User serialization helper /// /// @author Pierre Hubert UsersListSerialisationHelper _singleton; class UsersListSerialisationHelper extends BaseSerializationHelper { UsersListSerialisationHelper._(); factory UsersListSerialisationHelper() { if (_singleton == null) _singleton = UsersListSerialisationHelper._(); return _singleton; } @override String get type => "users-list"; @override User parse(Map m) => User.fromJson(m); /// Remove a user by its ID Future removeUserByID(int userID) => removeElement((t) => t.id == userID); }