diff --git a/lib/routes/user_routes.dart b/lib/routes/user_routes.dart index ecd36ce..0ec1bae 100644 --- a/lib/routes/user_routes.dart +++ b/lib/routes/user_routes.dart @@ -4,6 +4,7 @@ import 'package:chat/views/user/info/index_page.dart'; import 'package:chat/views/user/info/nickname_page.dart'; import 'package:chat/views/user/qr_code/index_page.dart'; import 'package:chat/views/user/safe/index_page.dart'; +import 'package:chat/views/user/serve/index_page.dart'; import 'package:chat/views/user/setting/index_page.dart'; import 'package:chat/views/user/share/index_page.dart'; import 'package:get/get.dart'; @@ -17,6 +18,7 @@ abstract class UserRoutes { static const String safe = '/user/safe'; static const String info = '/user/info'; static const String infoNickname = '/user/info/nickname'; + static const String serve = '/user/serve'; static GetPage router = GetPage( name: UserRoutes.index, @@ -51,6 +53,10 @@ abstract class UserRoutes { ), ], ), + GetPage( + name: '/serve', + page: () => const UserServePage(), + ), ], ); } diff --git a/lib/services/tim/conversation_service.dart b/lib/services/tim/conversation_service.dart index d479f39..d48e8b8 100644 --- a/lib/services/tim/conversation_service.dart +++ b/lib/services/tim/conversation_service.dart @@ -337,6 +337,7 @@ class TimConversationService extends GetxService { } } + /// 发送消息 Future _sendMessage( V2TimConversation conversation, V2TimMsgCreateInfoResult result, @@ -357,7 +358,6 @@ class TimConversationService extends GetxService { if (sendMessageRes.code == 0) { // TimMessageService.to // .add(conversation.conversationID, result.messageInfo!); - // eventBus.fire(result.messageInfo!); fetchList(); return true; } else { diff --git a/lib/services/tim_service.dart b/lib/services/tim_service.dart index 47fd7c1..eb0ad9f 100644 --- a/lib/services/tim_service.dart +++ b/lib/services/tim_service.dart @@ -380,8 +380,6 @@ class TimService extends GetxService { Future.delayed(const Duration(milliseconds: 500), () async { await TimConversationService.to.fetchList(); }); - - // eventBus.fire(message); } /// 通过消息判断是否是当前会话 diff --git a/lib/views/conversation/widgets/message_field.dart b/lib/views/conversation/widgets/message_field.dart index b799290..d2f0d44 100644 --- a/lib/views/conversation/widgets/message_field.dart +++ b/lib/views/conversation/widgets/message_field.dart @@ -650,7 +650,6 @@ class _MessageFieldState extends State { Widget _getBottomContainer() { if (showEmojiPanel) { - // eventBus.fire('scrollToBottom'); return EmojiPanel( onTapEmoji: (unicode) { final oldText = _controller.text; @@ -663,7 +662,6 @@ class _MessageFieldState extends State { ); } if (showMore) { - // eventBus.fire('scrollToBottom'); return GridView.count( shrinkWrap: true, physics: const NeverScrollableScrollPhysics(), diff --git a/lib/views/conversation/widgets/message_list.dart b/lib/views/conversation/widgets/message_list.dart index 8b9b5c3..9aec3c6 100644 --- a/lib/views/conversation/widgets/message_list.dart +++ b/lib/views/conversation/widgets/message_list.dart @@ -42,32 +42,6 @@ class _MessageListState extends State { axis: Axis.vertical, ); - /// 接收到消息 和 自己发送消息 使列表滚动到最底部 - // eventBus.on().listen((event) { - // if (TimMessageService.to.curConversationId == - // widget.conversation.conversationID) { - // if (event is V2TimMessage) { - // if (mounted) { - // setState(() { - // TimMessageService.to.addMessage(event); - // }); - // } - // _scrollController.scrollToIndex( - // TimMessageService.to.messages.length - 1, - // preferPosition: AutoScrollPosition.begin, - // ); - // } - // } - // if (event is String && event == 'scrollToBottom') { - // Future.delayed(const Duration(milliseconds: 200), () { - // _scrollController.animateTo( - // _scrollController.position.maxScrollExtent, - // duration: const Duration(milliseconds: 200), - // curve: Curves.easeOut, - // ); - // }); - // } - // }); _loadMessages(); } diff --git a/lib/views/conversation/widgets/show_sound_message.dart b/lib/views/conversation/widgets/show_sound_message.dart index 51a90fc..dfc3dbb 100644 --- a/lib/views/conversation/widgets/show_sound_message.dart +++ b/lib/views/conversation/widgets/show_sound_message.dart @@ -39,11 +39,6 @@ class _ShowSoundMessageState extends State { }); } }); - // eventBus.on().listen((event) { - // if (event == 'stop') { - // stopAndDispose(); - // } - // }); } void stopAndDispose() async { diff --git a/lib/views/user/index/index_page.dart b/lib/views/user/index/index_page.dart index f112e68..797ca7e 100644 --- a/lib/views/user/index/index_page.dart +++ b/lib/views/user/index/index_page.dart @@ -32,7 +32,7 @@ class _UserPageState extends State { ActionItem( '服务', onTap: () { - Get.toNamed(UserRoutes.share); + Get.toNamed(UserRoutes.serve); }, ), const Divider( diff --git a/lib/views/user/serve/index_page.dart b/lib/views/user/serve/index_page.dart new file mode 100644 index 0000000..306e54b --- /dev/null +++ b/lib/views/user/serve/index_page.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; + +class UserServePage extends StatefulWidget { + const UserServePage({Key? key}) : super(key: key); + + @override + State createState() => _UserServePageState(); +} + +class _UserServePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('服务'), + ), + body: Container(), + ); + } +}