Przeglądaj źródła

Remove unnecessary rebuild

ashilkn 2 lat temu
rodzic
commit
6bbc63cbc7
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5 3
      lib/ui/collection_action_sheet.dart

+ 5 - 3
lib/ui/collection_action_sheet.dart

@@ -155,9 +155,11 @@ class _CollectionActionSheetState extends State<CollectionActionSheet> {
                             prefixIcon: Icons.search_rounded,
                             autoFocus: true,
                             onChange: (value) {
-                              setState(() {
-                                _searchQuery = value;
-                              });
+                              value != _searchQuery
+                                  ? setState(() {
+                                      _searchQuery = value;
+                                    })
+                                  : null;
                             },
                             cancellable: true,
                             shouldUnfocusOnCancelOrSubmit: true,