diff --git a/mobile/lib/ui/tabs/shared_collections_tab.dart b/mobile/lib/ui/tabs/shared_collections_tab.dart index 247783161c..7e93abca39 100644 --- a/mobile/lib/ui/tabs/shared_collections_tab.dart +++ b/mobile/lib/ui/tabs/shared_collections_tab.dart @@ -3,16 +3,13 @@ import "dart:math"; import 'package:flutter/material.dart'; import 'package:logging/logging.dart'; -import "package:photos/core/constants.dart"; import 'package:photos/core/event_bus.dart'; import 'package:photos/events/collection_updated_event.dart'; import 'package:photos/events/local_photos_updated_event.dart'; import 'package:photos/events/user_logged_out_event.dart'; import "package:photos/generated/l10n.dart"; import 'package:photos/models/collection/collection_items.dart'; -import "package:photos/models/search/generic_search_result.dart"; import 'package:photos/services/collections_service.dart'; -import "package:photos/services/search_service.dart"; import "package:photos/ui/collections/album/row_item.dart"; import "package:photos/ui/collections/collection_list_page.dart"; import 'package:photos/ui/common/loading_widget.dart'; @@ -23,7 +20,6 @@ import "package:photos/ui/tabs/shared/empty_state.dart"; import "package:photos/ui/tabs/shared/quick_link_album_item.dart"; import "package:photos/ui/viewer/gallery/collect_photos_card_widget.dart"; import "package:photos/ui/viewer/gallery/collection_page.dart"; -import "package:photos/ui/viewer/search_tab/contacts_section.dart"; import "package:photos/utils/debouncer.dart"; import "package:photos/utils/navigation_util.dart"; @@ -294,27 +290,6 @@ class _SharedCollectionsTabState extends State ), ) : const SizedBox.shrink(), - const SizedBox(height: 2), - FutureBuilder( - future: SearchService.instance - .getAllContactsSearchResults(kSearchSectionLimit), - builder: (context, snapshot) { - if (snapshot.hasData) { - return ContactsSection( - snapshot.data as List, - ); - } else if (snapshot.hasError) { - _logger.severe( - "failed to load contacts section", - snapshot.error, - snapshot.stackTrace, - ); - return const EnteLoadingWidget(); - } else { - return const EnteLoadingWidget(); - } - }, - ), const SizedBox(height: 4), const CollectPhotosCardWidget(), const SizedBox(height: 32), diff --git a/mobile/lib/ui/viewer/search_tab/contacts_section.dart b/mobile/lib/ui/viewer/search_tab/contacts_section.dart index 25662e2c1b..dc52a5b5fe 100644 --- a/mobile/lib/ui/viewer/search_tab/contacts_section.dart +++ b/mobile/lib/ui/viewer/search_tab/contacts_section.dart @@ -100,23 +100,30 @@ class _ContactsSectionState extends State { ), const ContactCTA(), ]; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SectionHeader( - SectionType.contacts, - hasMore: (_contactSearchResults.length >= kSearchSectionLimit - 1), - ), - SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 4.5), - physics: const BouncingScrollPhysics(), - scrollDirection: Axis.horizontal, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: recommendations, + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SectionHeader( + SectionType.contacts, + hasMore: + (_contactSearchResults.length >= kSearchSectionLimit - 1), ), - ), - ], + const SizedBox(height: 2), + SizedBox( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 4.5), + physics: const BouncingScrollPhysics(), + scrollDirection: Axis.horizontal, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: recommendations, + ), + ), + ), + ], + ), ); } } diff --git a/mobile/lib/ui/viewer/search_tab/search_tab.dart b/mobile/lib/ui/viewer/search_tab/search_tab.dart index ae5d8ed7ad..27e3f46830 100644 --- a/mobile/lib/ui/viewer/search_tab/search_tab.dart +++ b/mobile/lib/ui/viewer/search_tab/search_tab.dart @@ -17,6 +17,7 @@ import "package:photos/ui/viewer/search/result/no_result_widget.dart"; import "package:photos/ui/viewer/search/search_suggestions.dart"; import "package:photos/ui/viewer/search/tab_empty_state.dart"; import 'package:photos/ui/viewer/search_tab/albums_section.dart'; +import "package:photos/ui/viewer/search_tab/contacts_section.dart"; import "package:photos/ui/viewer/search_tab/file_type_section.dart"; import "package:photos/ui/viewer/search_tab/locations_section.dart"; import "package:photos/ui/viewer/search_tab/magic_section.dart"; @@ -144,11 +145,10 @@ class _AllSearchSectionsState extends State { as List, ); case SectionType.contacts: - // return ContactsSection( - // snapshot.data!.elementAt(index) - // as List, - // ); - return const SizedBox.shrink(); + return ContactsSection( + snapshot.data!.elementAt(index) + as List, + ); case SectionType.fileTypesAndExtension: return FileTypeSection( snapshot.data!.elementAt(index)