mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-21 20:39:22 +00:00
Can report user
This commit is contained in:
parent
504be2e5ef
commit
64bbce2084
@ -1,8 +1,12 @@
|
||||
import 'package:comunic/enums/report_target_type.dart';
|
||||
import 'package:comunic/enums/user_page_visibility.dart';
|
||||
import 'package:comunic/helpers/friends_helper.dart';
|
||||
import 'package:comunic/helpers/server_config_helper.dart';
|
||||
import 'package:comunic/models/advanced_user_info.dart';
|
||||
import 'package:comunic/models/displayed_content.dart';
|
||||
import 'package:comunic/models/friend_status.dart';
|
||||
import 'package:comunic/models/report_target.dart';
|
||||
import 'package:comunic/ui/dialogs/report_dialog.dart';
|
||||
import 'package:comunic/ui/widgets/FrienshipStatusWidget.dart';
|
||||
import 'package:comunic/ui/widgets/async_screen_widget.dart';
|
||||
import 'package:comunic/ui/widgets/text_widget.dart';
|
||||
@ -129,6 +133,21 @@ class _AboutUserSectionState extends State<AboutUserSection> {
|
||||
? tr("Public page")!
|
||||
: tr("Private page")!)),
|
||||
),
|
||||
|
||||
// Report user
|
||||
!widget.user.isCurrentUser && srvConfig!.isReportingEnabled
|
||||
? ListTile(
|
||||
textColor: Colors.red,
|
||||
leading: Icon(Icons.flag, color: Colors.red),
|
||||
title: Text(tr("Report abuse")!),
|
||||
onTap: _reportAbuse,
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
);
|
||||
|
||||
/// Report user
|
||||
void _reportAbuse() => showReportDialog(
|
||||
ctx: context,
|
||||
target: ReportTarget(ReportTargetType.User, widget.user.id));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user