π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
pref improvement
ashilkn3574280dec0f
diff --git a/lib/ui/viewer/search/search_widget_new.dart b/lib/ui/viewer/search/search_widget_new.dartindex b11ae55063..fc35965efa 100644--- a/lib/ui/viewer/search/search_widget_new.dart+++ b/lib/ui/viewer/search/search_widget_new.dart@@ -73,96 +73,95 @@ class _SearchWidgetNewState extends State<SearchWidgetNew> {key: widgetKey,child: ValueListenableBuilder(valueListenable: _bottomPaddingNotifier,- builder: (context, value, _) {+ builder: (context, value, child) {return Padding(padding: EdgeInsets.only(bottom: value),- //Use the bottom widget as child for valueListenableBuilder for- //better perf.- child: Padding(- padding: const EdgeInsets.symmetric(vertical: 12),- child: Padding(- padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 8),+ child: child,+ );+ },+ child: Padding(+ padding: const EdgeInsets.symmetric(vertical: 12),+ child: Padding(+ padding: const EdgeInsets.symmetric(vertical: 2, horizontal: 8),+ child: Container(+ color: colorScheme.backgroundBase,+ child: ClipRRect(+ borderRadius: BorderRadius.circular(8),child: Container(- color: colorScheme.backgroundBase,- child: ClipRRect(- borderRadius: BorderRadius.circular(8),- child: Container(- height: 44,- color: colorScheme.fillFaint,- child: TextFormField(- style: Theme.of(context).textTheme.titleMedium,- // Below parameters are to disable auto-suggestion- enableSuggestions: false,- autocorrect: false,- // Above parameters are to disable auto-suggestion- decoration: InputDecoration(- // hintText: S.of(context).searchHintText,- hintText: "Search",- filled: true,- contentPadding: const EdgeInsets.symmetric(- vertical: 10,- ),- border: const UnderlineInputBorder(- borderSide: BorderSide.none,- ),- focusedBorder: const UnderlineInputBorder(- borderSide: BorderSide.none,- ),- prefixIconConstraints: const BoxConstraints(- maxHeight: 44,- maxWidth: 44,- minHeight: 44,- minWidth: 44,- ),- suffixIconConstraints: const BoxConstraints(- maxHeight: 44,- maxWidth: 44,- minHeight: 44,- minWidth: 44,- ),- prefixIcon: Hero(- tag: "search_icon",- child: Icon(- Icons.search,- color: colorScheme.strokeFaint,- ),- ),- /*Using valueListenableBuilder inside a stateful widget because this widget is only rebuild when- setState is called when deboucncing is over and the spinner needs to be shown while debouncing */- suffixIcon: ValueListenableBuilder(- valueListenable: _debouncer.debounceActiveNotifier,- builder: (- BuildContext context,- bool isDebouncing,- Widget? child,- ) {- return SearchSuffixIcon(- isDebouncing,- );- },- ),+ height: 44,+ color: colorScheme.fillFaint,+ child: TextFormField(+ style: Theme.of(context).textTheme.titleMedium,+ // Below parameters are to disable auto-suggestion+ enableSuggestions: false,+ autocorrect: false,+ // Above parameters are to disable auto-suggestion+ decoration: InputDecoration(+ // hintText: S.of(context).searchHintText,+ hintText: "Search",+ filled: true,+ contentPadding: const EdgeInsets.symmetric(+ vertical: 10,+ ),+ border: const UnderlineInputBorder(+ borderSide: BorderSide.none,+ ),+ focusedBorder: const UnderlineInputBorder(+ borderSide: BorderSide.none,+ ),+ prefixIconConstraints: const BoxConstraints(+ maxHeight: 44,+ maxWidth: 44,+ minHeight: 44,+ minWidth: 44,+ ),+ suffixIconConstraints: const BoxConstraints(+ maxHeight: 44,+ maxWidth: 44,+ minHeight: 44,+ minWidth: 44,+ ),+ prefixIcon: Hero(+ tag: "search_icon",+ child: Icon(+ Icons.search,+ color: colorScheme.strokeFaint,),- onChanged: (value) async {- _query = value;- final List<SearchResult> allResults =- await getSearchResultsForQuery(context, value);- /*checking if _query == value to make sure that the results are from the current query- and not from the previous query (race condition).*/- if (mounted && _query == value) {- setState(() {- _results.clear();- _results.addAll(allResults);- });- }+ ),+ /*Using valueListenableBuilder inside a stateful widget because this widget is only rebuild when+ setState is called when deboucncing is over and the spinner needs to be shown while debouncing */+ suffixIcon: ValueListenableBuilder(+ valueListenable: _debouncer.debounceActiveNotifier,+ builder: (+ BuildContext context,+ bool isDebouncing,+ Widget? child,+ ) {+ return SearchSuffixIcon(+ isDebouncing,+ );},),),+ onChanged: (value) async {+ _query = value;+ final List<SearchResult> allResults =+ await getSearchResultsForQuery(context, value);+ /*checking if _query == value to make sure that the results are from the current query+ and not from the previous query (race condition).*/+ if (mounted && _query == value) {+ setState(() {+ _results.clear();+ _results.addAll(allResults);+ });+ }+ },),),),),- );- },+ ),+ ),),);}