removeEvent method
Implementation
@override
Future<void> removeEvent(String eventId, String roomId) async {
await _eventsBox.delete(TupleKey(roomId, eventId).toString());
final keys = await _timelineFragmentsBox.getAllKeys();
for (final key in keys) {
final multiKey = TupleKey.fromString(key);
if (multiKey.parts.first != roomId) continue;
final eventIds =
List<String>.from(await _timelineFragmentsBox.get(key) ?? []);
final prevLength = eventIds.length;
eventIds.removeWhere((id) => id == eventId);
if (eventIds.length < prevLength) {
await _timelineFragmentsBox.put(key, eventIds);
}
}
return;
}