Skip to content

Commit

Permalink
TW-1406: can not go back in chat search screen in android
Browse files Browse the repository at this point in the history
  • Loading branch information
sherlockvn authored and hoangdat committed Mar 8, 2024
1 parent 11d33f8 commit 03d8e54
Showing 1 changed file with 16 additions and 25 deletions.
41 changes: 16 additions & 25 deletions lib/pages/chat_search/chat_search_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import 'package:fluffychat/presentation/same_type_events_builder/same_type_event
import 'package:fluffychat/utils/date_time_extension.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart';
import 'package:fluffychat/utils/matrix_sdk_extensions/result_extension.dart';
import 'package:fluffychat/utils/platform_infos.dart';
import 'package:fluffychat/utils/string_extension.dart';
import 'package:fluffychat/widgets/avatar/avatar.dart';
import 'package:fluffychat/widgets/highlight_text.dart';
Expand All @@ -38,32 +37,24 @@ class ChatSearchView extends StatelessWidget {

@override
Widget build(BuildContext context) {
return PopScope(
canPop: false,
onPopInvoked: (isPop) async {
if (PlatformInfos.isAndroid) {
controller.onBack();
}
},
child: Scaffold(
return Scaffold(
backgroundColor: LinagoraSysColors.material().onPrimary,
appBar: AppBar(
toolbarHeight: AppConfig.toolbarHeight(context),
backgroundColor: LinagoraSysColors.material().onPrimary,
appBar: AppBar(
toolbarHeight: AppConfig.toolbarHeight(context),
backgroundColor: LinagoraSysColors.material().onPrimary,
automaticallyImplyLeading: false,
title: _ChatSearchAppBar(controller),
),
body: controller.sameTypeEventsBuilderController != null
? _TimelineSearchView(
controller: controller,
sameTypeEventsBuilderController:
controller.sameTypeEventsBuilderController!,
)
: _ServerSearchView(
controller: controller,
serverSearchController: controller.serverSearchController,
),
automaticallyImplyLeading: false,
title: _ChatSearchAppBar(controller),
),
body: controller.sameTypeEventsBuilderController != null
? _TimelineSearchView(
controller: controller,
sameTypeEventsBuilderController:
controller.sameTypeEventsBuilderController!,
)
: _ServerSearchView(
controller: controller,
serverSearchController: controller.serverSearchController,
),
);
}
}
Expand Down

0 comments on commit 03d8e54

Please sign in to comment.