From 23152b6ec09f2b9a697d442db4f34c6b87de4522 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Wed, 20 Dec 2023 19:20:05 +0530 Subject: [PATCH] change paddings --- lib/ui/search_tab.dart | 120 ++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/lib/ui/search_tab.dart b/lib/ui/search_tab.dart index a54a131f6..2392619d7 100644 --- a/lib/ui/search_tab.dart +++ b/lib/ui/search_tab.dart @@ -40,18 +40,15 @@ class _SearchTabState extends State { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.only(top: 8), - child: AllSectionsExamplesProvider( - child: FadeIndexedStack( - duration: const Duration(milliseconds: 150), - index: index, - children: [ - const AllSearchSections(), - SearchSuggestionsWidget(_searchResults), - const NoResultWidget(), - ], - ), + return AllSectionsExamplesProvider( + child: FadeIndexedStack( + duration: const Duration(milliseconds: 150), + index: index, + children: [ + const AllSearchSections(), + SearchSuggestionsWidget(_searchResults), + const NoResultWidget(), + ], ), ); } @@ -71,58 +68,61 @@ class _AllSearchSectionsState extends State { // remove face and content sectionType searchTypes.remove(SectionType.face); searchTypes.remove(SectionType.content); - return Stack( - children: [ - FutureBuilder( - future: InheritedAllSectionsExamples.of(context) - .allSectionsExamplesFuture, - builder: (context, snapshot) { - if (snapshot.hasData) { - if (snapshot.data!.every((element) => element.isEmpty)) { + return Padding( + padding: const EdgeInsets.only(top: 8), + child: Stack( + children: [ + FutureBuilder( + future: InheritedAllSectionsExamples.of(context) + .allSectionsExamplesFuture, + builder: (context, snapshot) { + if (snapshot.hasData) { + if (snapshot.data!.every((element) => element.isEmpty)) { + return const Padding( + padding: EdgeInsets.only(bottom: 72), + child: SearchTabEmptyState(), + ); + } + return ListView.builder( + padding: const EdgeInsets.only(bottom: 180), + physics: const BouncingScrollPhysics(), + itemCount: searchTypes.length, + itemBuilder: (context, index) { + return SearchSection( + sectionType: searchTypes[index], + examples: snapshot.data!.elementAt(index), + limit: searchSectionLimit, + ); + }, + ); + } else if (snapshot.hasError) { + //Errors are handled and this else if condition will be false always + //is the understanding. return const Padding( padding: EdgeInsets.only(bottom: 72), - child: SearchTabEmptyState(), + child: EnteLoadingWidget(), + ); + } else { + return const Padding( + padding: EdgeInsets.only(bottom: 72), + child: EnteLoadingWidget(), ); } - return ListView.builder( - padding: const EdgeInsets.only(bottom: 180), - physics: const BouncingScrollPhysics(), - itemCount: searchTypes.length, - itemBuilder: (context, index) { - return SearchSection( - sectionType: searchTypes[index], - examples: snapshot.data!.elementAt(index), - limit: searchSectionLimit, - ); - }, - ); - } else if (snapshot.hasError) { - //Errors are handled and this else if condition will be false always - //is the understanding. - return const Padding( - padding: EdgeInsets.only(bottom: 72), - child: EnteLoadingWidget(), - ); - } else { - return const Padding( - padding: EdgeInsets.only(bottom: 72), - child: EnteLoadingWidget(), - ); - } - }, - ), - ValueListenableBuilder( - valueListenable: - InheritedAllSectionsExamples.of(context).isDebouncingNotifier, - builder: (context, value, _) { - return value - ? const EnteLoadingWidget( - alignment: Alignment.topRight, - ) - : const SizedBox.shrink(); - }, - ), - ], + }, + ), + ValueListenableBuilder( + valueListenable: + InheritedAllSectionsExamples.of(context).isDebouncingNotifier, + builder: (context, value, _) { + return value + ? const EnteLoadingWidget( + alignment: Alignment.topRight, + ) + : const SizedBox.shrink(); + }, + ), + ], + ), ); } }