Skip to content

Commit

Permalink
TW-1578: clean the unused params and variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn authored and hoangdat committed Apr 2, 2024
1 parent 1215c02 commit 629c2ab
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 36 deletions.
5 changes: 1 addition & 4 deletions lib/pages/search/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -32,10 +31,8 @@ class Search extends StatefulWidget {
State<Search> createState() => SearchController();
}

class SearchController extends State<Search>
with ComparablePresentationSearchMixin {
class SearchController extends State<Search> {
static const int limitPrefetchedRecentChats = 3;
static const int limitSearchingPrefetchedRecentContacts = 30;
static const int limitPrefetchedRecentContacts = 5;
static const _prefixLengthHighlight = 20;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -95,15 +94,6 @@ class AppAdaptiveScaffoldBodyController extends State<AppAdaptiveScaffoldBody> {
_jumpToPageByIndex();
}

void _onOpenSearchPage() {
pageController.jumpToPage(AdaptiveDestinationEnum.search.index);
}

void _onCloseSearchPage() {
activeNavigationBarNotifier.value = AdaptiveDestinationEnum.rooms;
_jumpToPageByIndex();
}

void _jumpToPageByIndex() {
pageController.jumpToPage(activeNavigationBarNotifier.value.index);
}
Expand Down Expand Up @@ -163,8 +153,6 @@ class AppAdaptiveScaffoldBodyController extends State<AppAdaptiveScaffoldBody> {
activeRoomIdNotifier: activeRoomIdNotifier,
activeNavigationBarNotifier: activeNavigationBarNotifier,
pageController: pageController,
onOpenSearchPage: _onOpenSearchPage,
onCloseSearchPage: _onCloseSearchPage,
onDestinationSelected: onDestinationSelected,
onClientSelected: clientSelected,
onPopInvoked: _onPopInvoked,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -19,8 +18,6 @@ import 'package:linagora_design_flutter/linagora_design_flutter.dart'
class AppAdaptiveScaffoldBodyView extends StatelessWidget {
final List<AdaptiveDestinationEnum> destinations;
final ValueNotifier<AdaptiveDestinationEnum> activeNavigationBarNotifier;
final OnOpenSearchPage onOpenSearchPage;
final OnCloseSearchPage onCloseSearchPage;
final OnDestinationSelected onDestinationSelected;
final OnClientSelectedSetting onClientSelected;
final PageController pageController;
Expand All @@ -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,
Expand Down Expand Up @@ -123,8 +118,6 @@ class AppAdaptiveScaffoldBodyView extends StatelessWidget {
activeNavigationBarNotifier:
activeNavigationBarNotifier,
pageController: pageController,
onOpenSearchPage: onOpenSearchPage,
onCloseSearchPage: onCloseSearchPage,
onDestinationSelected:
onDestinationSelected,
onClientSelected: onClientSelected,
Expand Down Expand Up @@ -153,8 +146,6 @@ class AppAdaptiveScaffoldBodyView extends StatelessWidget {
activeRoomIdNotifier: activeRoomIdNotifier,
activeNavigationBarNotifier: activeNavigationBarNotifier,
pageController: pageController,
onOpenSearchPage: onOpenSearchPage,
onCloseSearchPage: onCloseSearchPage,
onDestinationSelected: onDestinationSelected,
onClientSelected: onClientSelected,
destinations: destinations,
Expand Down Expand Up @@ -183,8 +174,6 @@ class _ColumnPageView extends StatelessWidget {
final List<AdaptiveDestinationEnum> destinations;
final ValueNotifier<AdaptiveDestinationEnum> activeNavigationBarNotifier;
final PageController pageController;
final OnOpenSearchPage onOpenSearchPage;
final OnCloseSearchPage onCloseSearchPage;
final OnDestinationSelected onDestinationSelected;
final OnClientSelectedSetting onClientSelected;
final ValueKey bottomNavigationKey;
Expand All @@ -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,
Expand All @@ -223,7 +210,6 @@ class _ColumnPageView extends StatelessWidget {
navigatorBarType: AdaptiveDestinationEnum.rooms,
navigatorBarWidget: _bottomNavigationBarBuilder(context),
),
onOpenSearchPage: onOpenSearchPage,
activeRoomIdNotifier: activeRoomIdNotifier,
onOpenSettings: onOpenSettings,
adaptiveScaffoldBodyArgs: adaptiveScaffoldBodyArgs,
Expand All @@ -234,9 +220,6 @@ class _ColumnPageView extends StatelessWidget {
bottomNavigationBar: _bottomNavigationBarBuilder(context),
),
),
Search(
onCloseSearchPage: onCloseSearchPage,
),
],
);
}
Expand Down
4 changes: 1 addition & 3 deletions lib/widgets/layouts/enum/adaptive_destinations_enum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -19,7 +18,6 @@ enum AdaptiveDestinationEnum {
),
label: L10n.of(context)!.contacts,
);
case AdaptiveDestinationEnum.search:
case AdaptiveDestinationEnum.rooms:
return NavigationDestination(
icon: UnreadRoomsBadge(
Expand Down

0 comments on commit 629c2ab

Please sign in to comment.