From a97dddf8e5280ec7577cbaa590d76e4ce2ebb1e8 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:39:25 +0530 Subject: [PATCH] [auth] Clean up trash actions --- .../code_selection_actions_widget.dart | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/auth/lib/ui/components/code_selection_actions_widget.dart b/auth/lib/ui/components/code_selection_actions_widget.dart index 1d730fe63f..9f5de889f9 100644 --- a/auth/lib/ui/components/code_selection_actions_widget.dart +++ b/auth/lib/ui/components/code_selection_actions_widget.dart @@ -33,6 +33,7 @@ class CodeSelectionActionsWidget extends StatefulWidget { class _CodeSelectionActionsWidgetState extends State { late final scrollController = ScrollController(); + // static final _logger = Logger("CodeSelectionActionsWidget"); @override @@ -45,30 +46,32 @@ class _CodeSelectionActionsWidgetState Widget build(BuildContext context) { final List items = []; - items.add( - SelectionActionButton( - labelText: context.l10n.share, - icon: Icons.adaptive.share_outlined, - onTap: widget.onShare, - ), - ); - items.add( - SelectionActionButton( - labelText: 'QR', - icon: Icons.qr_code_2_outlined, - onTap: widget.onShowQR, - ), - ); + if (!widget.code.isTrashed) { + items.add( + SelectionActionButton( + labelText: context.l10n.share, + icon: Icons.adaptive.share_outlined, + onTap: widget.onShare, + ), + ); + items.add( + SelectionActionButton( + labelText: 'QR', + icon: Icons.qr_code_2_outlined, + onTap: widget.onShowQR, + ), + ); - items.add( - SelectionActionButton( - labelText: widget.code.isPinned - ? context.l10n.unpinText - : context.l10n.pinText, - icon: widget.code.isPinned ? Icons.push_pin : Icons.push_pin_outlined, - onTap: widget.onPin, - ), - ); + items.add( + SelectionActionButton( + labelText: widget.code.isPinned + ? context.l10n.unpinText + : context.l10n.pinText, + icon: widget.code.isPinned ? Icons.push_pin : Icons.push_pin_outlined, + onTap: widget.onPin, + ), + ); + } if (widget.code.isTrashed) { items.add(