Browse Source

fix: unselect tag on tap on selected one

Prateek Sunal 1 năm trước cách đây
mục cha
commit
ee5362ad6c
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      auth/lib/ui/home_page.dart

+ 6 - 0
auth/lib/ui/home_page.dart

@@ -316,6 +316,12 @@ class _HomePageState extends State<HomePage> {
                         ? TagChipState.selected
                         : TagChipState.unselected,
                     onTap: () {
+                      if (selectedTag == _codes!.tags[index - 1]) {
+                        selectedTag = "";
+                        setState(() {});
+                        _applyFilteringAndRefresh();
+                        return;
+                      }
                       selectedTag = _codes!.tags[index - 1];
                       setState(() {});
                       _applyFilteringAndRefresh();