From 3ad8d08195684d4bc705b9a07805439144e4f121 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Fri, 24 May 2024 19:44:23 +0900 Subject: [PATCH] hide mod dashboard buttons for kick --- .../twitch/moderation_bottom_sheet.dart | 67 ++++++++++--------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart b/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart index 7a3b0895..304c861f 100644 --- a/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart +++ b/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart @@ -95,40 +95,47 @@ class ModerationBottomSheet extends StatelessWidget { ), ), ), - InkWell( - onTap: () => controller.deleteMessageInstruction( - controller.homeViewController.selectedMessage.value!, + Visibility( + visible: message.platform == Platform.twitch, + child: InkWell( + onTap: () => controller.deleteMessageInstruction( + controller.homeViewController.selectedMessage.value!, + ), + child: moderationViewButton(null, "Delete message"), ), - child: moderationViewButton(null, "Delete message"), ), const SizedBox(height: 15), - Row(children: [ - InkWell( - onTap: () => controller.banMessageInstruction( - controller.homeViewController.selectedMessage.value!, + Visibility( + visible: message.platform == Platform.twitch, + + child: Row(children: [ + InkWell( + onTap: () => controller.banMessageInstruction( + controller.homeViewController.selectedMessage.value!, + ), + child: moderationViewButton(Icons.stop, "Ban"), ), - child: moderationViewButton(Icons.stop, "Ban"), - ), - const SizedBox(width: 10), - InkWell( - onTap: () => timeoutDialog(), - child: moderationViewButton(Icons.timer, "Timeout"), - ), - const SizedBox(width: 10), - InkWell( - onTap: () => controller.hideUser( - controller.homeViewController.selectedMessage.value!), - child: (controller - .homeViewController.settings.value.hiddenUsersIds! - .firstWhereOrNull((userId) => - controller.homeViewController.selectedMessage - .value!.authorId == - userId) != - null) - ? moderationViewButton(Icons.visibility, "Unhide user") - : moderationViewButton(Icons.visibility_off, "Hide user"), - ), - ]), + const SizedBox(width: 10), + InkWell( + onTap: () => timeoutDialog(), + child: moderationViewButton(Icons.timer, "Timeout"), + ), + const SizedBox(width: 10), + InkWell( + onTap: () => controller.hideUser( + controller.homeViewController.selectedMessage.value!), + child: (controller + .homeViewController.settings.value.hiddenUsersIds! + .firstWhereOrNull((userId) => + controller.homeViewController.selectedMessage + .value!.authorId == + userId) != + null) + ? moderationViewButton(Icons.visibility, "Unhide user") + : moderationViewButton(Icons.visibility_off, "Hide user"), + ), + ]), + ), ], ), );