修改IM无法重复页面发消息
This commit is contained in:
parent
483e78002c
commit
af2701f7f8
@ -231,7 +231,12 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
if (kProfileMode) {
|
||||
Frame.destroy();
|
||||
}
|
||||
model.dispose();
|
||||
try {
|
||||
model.dispose();
|
||||
} catch (e) {
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
@ -417,7 +422,7 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
child: Container(
|
||||
color: theme.chatBgColor,
|
||||
child: Align(
|
||||
key: alignKey,
|
||||
// key: alignKey,
|
||||
alignment: Alignment.topCenter,
|
||||
child: Listener(
|
||||
onPointerMove: closePanel,
|
||||
@ -428,7 +433,7 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
widget.customEmojiStickerList,
|
||||
isUseDefaultEmoji:
|
||||
widget.config!.isUseDefaultEmoji,
|
||||
key: listContainerKey,
|
||||
// key: listContainerKey,
|
||||
isAllowScroll: true,
|
||||
userAvatarBuilder: widget.userAvatarBuilder,
|
||||
toolTipsConfig: widget.toolTipsConfig,
|
||||
@ -468,7 +473,7 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
: (widget.textFieldBuilder != null
|
||||
? widget.textFieldBuilder!(context)
|
||||
: TIMInputTextField(
|
||||
key: inputTextFieldState,
|
||||
// key: inputTextFieldState,
|
||||
atMemberPanelScroll:
|
||||
atMemberPanelScroll,
|
||||
groupType:
|
||||
|
||||
@ -10,14 +10,20 @@ import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class ChatPage extends StatelessWidget {
|
||||
final logic = Get.find<ChatLogic>();
|
||||
final state = Get.find<ChatLogic>().state;
|
||||
|
||||
class ChatPage extends StatefulWidget {
|
||||
|
||||
ChatPage({Key? key})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
State<ChatPage> createState() => _ChatPageState();
|
||||
}
|
||||
|
||||
class _ChatPageState extends State<ChatPage> {
|
||||
// final logic = Get.find<ChatLogic>();
|
||||
//
|
||||
// final state = Get.find<ChatLogic>().state;
|
||||
|
||||
Widget renderCustomStickerPanel({
|
||||
sendTextMessage,
|
||||
sendFaceMessage,
|
||||
@ -62,8 +68,9 @@ class ChatPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
V2TimConversation con = Get.arguments;
|
||||
return TIMChat(
|
||||
conversation: logic.selectedConversation!,
|
||||
conversation: Get.arguments,
|
||||
customStickerPanel: renderCustomStickerPanel,
|
||||
config: const TIMUIKitChatConfig(
|
||||
// 仅供演示,非全部配置项,实际使用中,可只传和默认项不同的参数,无需传入所有开关
|
||||
@ -81,10 +88,10 @@ class ChatPage extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
customAppBar: MyAppBar(
|
||||
centerTitle: logic.selectedConversation!.showName!,
|
||||
centerTitle: con.showName!,
|
||||
actionWdiget: GestureDetector(
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,arguments: logic.selectedConversation!.userID.toString().split('_').last);
|
||||
Get.toNamed(AppRoutes.UserInfoActivity,arguments: con.userID.toString().split('_').last);
|
||||
},
|
||||
child: Text('TA的主页',style: TextStyle(color: Color(0xFF00FFF4),fontSize:12.sp,fontWeight: FontWeight.w500),),
|
||||
),
|
||||
|
||||
@ -145,11 +145,9 @@ class _MyTabbedScreenState extends State<UserinfoPage>
|
||||
onTap: () {
|
||||
if (logic.userInfoBean != null) {
|
||||
|
||||
final chatLogic = Get.find<ChatLogic>();
|
||||
if (chatLogic.selectedConversation!.userID == logic.imId) {
|
||||
Get.back();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
pushChatPage(logic.userInfoBean!.id.toString(),logic.imId, logic.userInfoBean!.nickname);
|
||||
}
|
||||
},
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:circle_app/app/chat/logic.dart';
|
||||
import 'package:circle_app/app/splash/binding.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
@ -40,15 +41,15 @@ logoutIM() async {
|
||||
|
||||
//跳转发消息页面
|
||||
pushChatPage(String userId,String imId,String userName) async {
|
||||
await createCustomMsg(userId,imId);
|
||||
|
||||
|
||||
var con = V2TimConversation(
|
||||
conversationID: "c2c_$imId",
|
||||
userID: imId,
|
||||
showName: userName,
|
||||
type: 1);
|
||||
await createCustomMsg(userId,imId);
|
||||
Get.toNamed(AppRoutes.Chat,arguments: con);
|
||||
|
||||
}
|
||||
|
||||
createCustomMsg(String userId,String imId) async {
|
||||
|
||||
@ -167,7 +167,7 @@ class AppPages {
|
||||
GetPage(
|
||||
name: AppRoutes.Chat,
|
||||
page: () => ChatPage(),
|
||||
binding: ChatBinding(),
|
||||
// binding: ChatBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: AppRoutes.SelectCircleActivity,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user