block method
Implementation
Future<void> block() async {
if (reason.error.value != null) {
return;
}
blocklistStatus.value = RxStatus.loading();
try {
final String text = reason.text.trim();
await _userService.blockUser(
id,
text.isEmpty ? null : BlocklistReason(text),
);
reason.clear();
} on FormatException {
reason.error.value = 'err_blocklist_reason_does_not_meet_regexp'.l10n;
} catch (e) {
MessagePopup.error('err_data_transfer'.l10n);
} finally {
blocklistStatus.value = RxStatus.empty();
}
}