mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-01-23 18:44:10 +01:00
feature: ignore from bottom sheet
This commit is contained in:
parent
599c0acb7f
commit
e17376c5a2
@ -9,6 +9,7 @@ import 'package:future_loading_dialog/future_loading_dialog.dart';
|
|||||||
import 'package:vrouter/vrouter.dart';
|
import 'package:vrouter/vrouter.dart';
|
||||||
|
|
||||||
import 'views/user_bottom_sheet_view.dart';
|
import 'views/user_bottom_sheet_view.dart';
|
||||||
|
import '../widgets/matrix.dart';
|
||||||
|
|
||||||
class UserBottomSheet extends StatefulWidget {
|
class UserBottomSheet extends StatefulWidget {
|
||||||
final User user;
|
final User user;
|
||||||
@ -93,6 +94,13 @@ class UserBottomSheetController extends State<UserBottomSheet> {
|
|||||||
.toSegments(['rooms', roomIdResult.result]);
|
.toSegments(['rooms', roomIdResult.result]);
|
||||||
Navigator.of(context, rootNavigator: false).pop();
|
Navigator.of(context, rootNavigator: false).pop();
|
||||||
break;
|
break;
|
||||||
|
case 'ignore':
|
||||||
|
if (await _askConfirmation()) {
|
||||||
|
await showFutureLoadingDialog(
|
||||||
|
context: context,
|
||||||
|
future: () =>
|
||||||
|
Matrix.of(context).client.ignoreUser(widget.user.id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,14 @@ class UserBottomSheetView extends StatelessWidget {
|
|||||||
Icons.warning_outlined,
|
Icons.warning_outlined,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (!client.ignoredUsers.contains(user.id))
|
||||||
|
PopupMenuItem(
|
||||||
|
value: 'ignore',
|
||||||
|
child: _TextWithIcon(
|
||||||
|
L10n.of(context).ignore,
|
||||||
|
Icons.block,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
onSelected: controller.participantAction,
|
onSelected: controller.participantAction,
|
||||||
),
|
),
|
||||||
|
Loading…
Reference in New Issue
Block a user