hideChats method
- bool clear = false
Hides the selectedChats, clearing their histories as well if clear
is
true
.
Implementation
Future<void> hideChats([bool clear = false]) async {
selecting.value = false;
router.navigation.value = !selecting.value;
try {
await Future.wait(selectedChats.map(_chatService.hideChat));
if (clear) {
await Future.wait(selectedChats.map(_chatService.clearChat));
}
} on HideChatException catch (e) {
MessagePopup.error(e);
} on ClearChatException catch (e) {
MessagePopup.error(e);
} on UnfavoriteChatException catch (e) {
MessagePopup.error(e);
} catch (e) {
MessagePopup.error(e);
rethrow;
} finally {
selectedChats.clear();
}
}