diff --git a/flutter/lib/common/widgets/address_book.dart b/flutter/lib/common/widgets/address_book.dart index 2aceae508..58acc9ace 100644 --- a/flutter/lib/common/widgets/address_book.dart +++ b/flutter/lib/common/widgets/address_book.dart @@ -10,6 +10,8 @@ import 'package:get/get.dart'; import '../../common.dart'; import 'login.dart'; +final hideAbTagsPanel = false.obs; + class AddressBook extends StatefulWidget { final EdgeInsets? menuPadding; const AddressBook({Key? key, this.menuPadding}) : super(key: key); @@ -67,7 +69,9 @@ class _AddressBookState extends State { Widget _buildAddressBookDesktop() { return Row( children: [ - Container( + Offstage( + offstage: hideAbTagsPanel.value, + child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), border: @@ -89,7 +93,7 @@ class _AddressBookState extends State { ], ), ), - ).marginOnly(right: 12.0), + ).marginOnly(right: 12.0)), _buildPeersViews() ], ); diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 3882f866a..ab85b2960 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -69,6 +69,8 @@ class _PeerTabPageState extends State ? PeerUiType.list : PeerUiType.grid; } + hideAbTagsPanel.value = + bind.mainGetLocalOption(key: "hideAbTagsPanel").isNotEmpty; super.initState(); } @@ -102,6 +104,28 @@ class _PeerTabPageState extends State offstage: gFFI.peerTabModel.currentTab == 0, child: PeerSortDropdown().marginOnly(left: 8), ), + Offstage( + offstage: gFFI.peerTabModel.currentTab != 3, + child: InkWell( + child: Obx(() => Container( + padding: EdgeInsets.all(4.0), + decoration: hideAbTagsPanel.value + ? null + : BoxDecoration( + color: Theme.of(context).colorScheme.background, + borderRadius: BorderRadius.circular(6)), + child: Icon( + Icons.tag_rounded, + size: 18, + ))), + onTap: () async { + await bind.mainSetLocalOption( + key: "hideAbTagsPanel", + value: hideAbTagsPanel.value ? "" : "Y"); + hideAbTagsPanel.value = !hideAbTagsPanel.value; + }, + ).marginOnly(left: 8), + ), ], ), ),