diff --git a/lib/pages/search/search.dart b/lib/pages/search/search.dart index f9d03d3eb7..8124157bad 100644 --- a/lib/pages/search/search.dart +++ b/lib/pages/search/search.dart @@ -7,7 +7,6 @@ import 'package:fluffychat/domain/usecase/search/pre_search_recent_contacts_inte import 'package:fluffychat/pages/search/search_contacts_and_chats_controller.dart'; import 'package:fluffychat/pages/search/search_view.dart'; import 'package:fluffychat/pages/search/server_search_controller.dart'; -import 'package:fluffychat/presentation/mixins/comparable_presentation_search_mixin.dart'; import 'package:fluffychat/presentation/model/presentation_contact_constant.dart'; import 'package:fluffychat/presentation/model/search/presentation_search.dart'; import 'package:fluffychat/utils/dialog/twake_dialog.dart'; @@ -32,10 +31,8 @@ class Search extends StatefulWidget { State createState() => SearchController(); } -class SearchController extends State - with ComparablePresentationSearchMixin { +class SearchController extends State { static const int limitPrefetchedRecentChats = 3; - static const int limitSearchingPrefetchedRecentContacts = 30; static const int limitPrefetchedRecentContacts = 5; static const _prefixLengthHighlight = 20; diff --git a/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body.dart b/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body.dart index 90b149efcf..57d154fd6b 100644 --- a/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body.dart +++ b/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body.dart @@ -11,7 +11,6 @@ import 'package:fluffychat/widgets/matrix.dart'; import 'package:flutter/material.dart'; import 'package:matrix/matrix.dart'; -typedef OnOpenSearchPage = void Function(); typedef OnCloseSearchPage = void Function(); typedef OnClientSelectedSetting = void Function( Object object, @@ -95,15 +94,6 @@ class AppAdaptiveScaffoldBodyController extends State { _jumpToPageByIndex(); } - void _onOpenSearchPage() { - pageController.jumpToPage(AdaptiveDestinationEnum.search.index); - } - - void _onCloseSearchPage() { - activeNavigationBarNotifier.value = AdaptiveDestinationEnum.rooms; - _jumpToPageByIndex(); - } - void _jumpToPageByIndex() { pageController.jumpToPage(activeNavigationBarNotifier.value.index); } @@ -163,8 +153,6 @@ class AppAdaptiveScaffoldBodyController extends State { activeRoomIdNotifier: activeRoomIdNotifier, activeNavigationBarNotifier: activeNavigationBarNotifier, pageController: pageController, - onOpenSearchPage: _onOpenSearchPage, - onCloseSearchPage: _onCloseSearchPage, onDestinationSelected: onDestinationSelected, onClientSelected: clientSelected, onPopInvoked: _onPopInvoked, diff --git a/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart b/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart index b1030db584..772c5d3b5c 100644 --- a/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart +++ b/lib/widgets/layouts/adaptive_layout/app_adaptive_scaffold_body_view.dart @@ -2,7 +2,6 @@ import 'package:fluffychat/config/first_column_inner_routes.dart'; import 'package:fluffychat/di/global/get_it_initializer.dart'; import 'package:fluffychat/pages/chat_list/chat_list.dart'; import 'package:fluffychat/pages/contacts_tab/contacts_tab.dart'; -import 'package:fluffychat/pages/search/search.dart'; import 'package:fluffychat/pages/settings_dashboard/settings/settings.dart'; import 'package:fluffychat/utils/responsive/responsive_utils.dart'; import 'package:fluffychat/widgets/layouts/adaptive_layout/adaptive_scaffold_primary_navigation.dart'; @@ -19,8 +18,6 @@ import 'package:linagora_design_flutter/linagora_design_flutter.dart' class AppAdaptiveScaffoldBodyView extends StatelessWidget { final List destinations; final ValueNotifier activeNavigationBarNotifier; - final OnOpenSearchPage onOpenSearchPage; - final OnCloseSearchPage onCloseSearchPage; final OnDestinationSelected onDestinationSelected; final OnClientSelectedSetting onClientSelected; final PageController pageController; @@ -43,8 +40,6 @@ class AppAdaptiveScaffoldBodyView extends StatelessWidget { required this.activeRoomIdNotifier, required this.pageController, required this.activeNavigationBarNotifier, - required this.onOpenSearchPage, - required this.onCloseSearchPage, required this.onDestinationSelected, required this.onClientSelected, required this.destinations, @@ -123,8 +118,6 @@ class AppAdaptiveScaffoldBodyView extends StatelessWidget { activeNavigationBarNotifier: activeNavigationBarNotifier, pageController: pageController, - onOpenSearchPage: onOpenSearchPage, - onCloseSearchPage: onCloseSearchPage, onDestinationSelected: onDestinationSelected, onClientSelected: onClientSelected, @@ -153,8 +146,6 @@ class AppAdaptiveScaffoldBodyView extends StatelessWidget { activeRoomIdNotifier: activeRoomIdNotifier, activeNavigationBarNotifier: activeNavigationBarNotifier, pageController: pageController, - onOpenSearchPage: onOpenSearchPage, - onCloseSearchPage: onCloseSearchPage, onDestinationSelected: onDestinationSelected, onClientSelected: onClientSelected, destinations: destinations, @@ -183,8 +174,6 @@ class _ColumnPageView extends StatelessWidget { final List destinations; final ValueNotifier activeNavigationBarNotifier; final PageController pageController; - final OnOpenSearchPage onOpenSearchPage; - final OnCloseSearchPage onCloseSearchPage; final OnDestinationSelected onDestinationSelected; final OnClientSelectedSetting onClientSelected; final ValueKey bottomNavigationKey; @@ -196,8 +185,6 @@ class _ColumnPageView extends StatelessWidget { required this.activeNavigationBarNotifier, required this.activeRoomIdNotifier, required this.pageController, - required this.onOpenSearchPage, - required this.onCloseSearchPage, required this.onDestinationSelected, required this.onClientSelected, required this.destinations, @@ -223,7 +210,6 @@ class _ColumnPageView extends StatelessWidget { navigatorBarType: AdaptiveDestinationEnum.rooms, navigatorBarWidget: _bottomNavigationBarBuilder(context), ), - onOpenSearchPage: onOpenSearchPage, activeRoomIdNotifier: activeRoomIdNotifier, onOpenSettings: onOpenSettings, adaptiveScaffoldBodyArgs: adaptiveScaffoldBodyArgs, @@ -234,9 +220,6 @@ class _ColumnPageView extends StatelessWidget { bottomNavigationBar: _bottomNavigationBarBuilder(context), ), ), - Search( - onCloseSearchPage: onCloseSearchPage, - ), ], ); } diff --git a/lib/widgets/layouts/enum/adaptive_destinations_enum.dart b/lib/widgets/layouts/enum/adaptive_destinations_enum.dart index 0a4113d6f6..7a93b27376 100644 --- a/lib/widgets/layouts/enum/adaptive_destinations_enum.dart +++ b/lib/widgets/layouts/enum/adaptive_destinations_enum.dart @@ -7,8 +7,7 @@ import 'package:flutter_gen/gen_l10n/l10n.dart'; enum AdaptiveDestinationEnum { contacts, rooms, - settings, - search; + settings; NavigationDestination getNavigationDestination(BuildContext context) { switch (this) { @@ -19,7 +18,6 @@ enum AdaptiveDestinationEnum { ), label: L10n.of(context)!.contacts, ); - case AdaptiveDestinationEnum.search: case AdaptiveDestinationEnum.rooms: return NavigationDestination( icon: UnreadRoomsBadge(