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