Selaa lähdekoodia

minor changes

ashilkn 3 vuotta sitten
vanhempi
commit
a9dcdc6333

+ 3 - 3
lib/ui/viewer/search/search_suffix_icon_widget.dart

@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
 import 'package:photos/ente_theme_data.dart';
 
 class SearchSuffixIcon extends StatefulWidget {
-  final bool timerIsActive;
-  const SearchSuffixIcon(this.timerIsActive, {Key key}) : super(key: key);
+  final bool isDebouncing;
+  const SearchSuffixIcon(this.isDebouncing, {Key key}) : super(key: key);
 
   @override
   State<SearchSuffixIcon> createState() => _SearchSuffixIconState();
@@ -21,7 +21,7 @@ class _SearchSuffixIconState extends State<SearchSuffixIcon>
       begin: 0.0,
       end: 1.0,
     ).animate(controller);
-    if (widget.timerIsActive) {
+    if (widget.isDebouncing) {
       controller.forward();
       return FadeTransition(
         opacity: animation,

+ 2 - 0
lib/ui/viewer/search/search_widget.dart

@@ -144,6 +144,7 @@ class _SearchWidgetState extends State<SearchWidget> {
 
   @override
   void dispose() {
+    print('dispose');
     _debouncer.cancelDebounce();
     super.dispose();
   }
@@ -164,6 +165,7 @@ class _SearchWidgetState extends State<SearchWidget> {
   ) async {
     final List<SearchResult> allResults = [];
     if (query.isEmpty) {
+      // _debouncer.cancelDebounce();
       completer.complete(allResults);
       return;
     }

+ 3 - 1
lib/utils/debouncer.dart

@@ -23,7 +23,9 @@ class Debouncer {
   void cancelDebounce() {
     if (_debounceTimer != null) {
       _debounceTimer.cancel();
-      _debounceActiveNotifier.value = false;
+      print('cancelDebounce');
+      // _debounceActiveNotifier.value =
+      //     false; //to not show spinner when query is empty
     }
   }