submitReport method
Submits the report to the server.
Sends the report for the comment and optionally reports/blocks the user based on the current state.
commentId is the ID of the comment being reported.
userId is the ID of the user who created the comment.
After submission, resets the provider state and calls onUserBlocked if the user was blocked.
Implementation
Future<void> submitReport(String commentId, String userId) async {
_loading = true;
notifyListeners();
await Future.delayed(const Duration(milliseconds: 500));
await service.sendReportComment(commentId, selectedReason!.id);
if (_reportUser) {
await service.sendReportUser(userId);
}
if (_blockUser) {
await service.sendBlockUser(userId);
onUserBlocked();
}
_loading = false;
notifyListeners();
reset();
}