修改推送昵称无法显示、聊天页面有键盘返回页面底部白屏bug
This commit is contained in:
parent
696400d98f
commit
76969fa785
@ -379,7 +379,7 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
||||
},
|
||||
child: Scaffold(
|
||||
backgroundColor: Colors.transparent,
|
||||
resizeToAvoidBottomInset: false,
|
||||
// resizeToAvoidBottomInset: false,
|
||||
appBar:PreferredSize(
|
||||
preferredSize: const Size.fromHeight(48.0),
|
||||
child: Stack(
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:circle_app/app/chat/TIMUIKitChat/tim_uikit_chat.dart';
|
||||
import 'package:circle_app/app/minefragment/logic.dart';
|
||||
import 'package:circle_app/components/my_app_bar.dart';
|
||||
import 'package:circle_app/network/api.dart';
|
||||
import 'package:circle_app/network/dio_manager.dart';
|
||||
import 'package:circle_app/router/app_routers.dart';
|
||||
import 'package:circle_app/util/util.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/business_logic/view_models/tui_chat_global_model.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
|
||||
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.dart';
|
||||
|
||||
@ -29,11 +33,14 @@ class _ChatPageState extends State<ChatPage> {
|
||||
final TIMUIKitChatController _timuiKitChatController =
|
||||
TIMUIKitChatController();
|
||||
|
||||
User? userInfoBean;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
initEventBus();
|
||||
loadMyInfo();
|
||||
}
|
||||
|
||||
|
||||
@ -106,7 +113,7 @@ class _ChatPageState extends State<ChatPage> {
|
||||
// });
|
||||
},
|
||||
controller : _timuiKitChatController,
|
||||
config: const TIMUIKitChatConfig(
|
||||
config: TIMUIKitChatConfig(
|
||||
// 仅供演示,非全部配置项,实际使用中,可只传和默认项不同的参数,无需传入所有开关
|
||||
isAllowClickAvatar: true,
|
||||
isUseDefaultEmoji: true,
|
||||
@ -116,7 +123,36 @@ class _ChatPageState extends State<ChatPage> {
|
||||
notificationTitle: "",
|
||||
isUseMessageReaction: true,
|
||||
|
||||
notificationBody: (V2TimMessage message, String convID, ConvType convType) {
|
||||
// V2TIM_ELEM_TYPE_NONE = 0, ///< 未知消息
|
||||
// V2TIM_ELEM_TYPE_TEXT = 1, ///< 文本消息
|
||||
// V2TIM_ELEM_TYPE_CUSTOM = 2, ///< 自定义消息
|
||||
// V2TIM_ELEM_TYPE_IMAGE = 3, ///< 图片消息
|
||||
// V2TIM_ELEM_TYPE_SOUND = 4, ///< 语音消息
|
||||
// V2TIM_ELEM_TYPE_VIDEO = 5, ///< 视频消息
|
||||
// V2TIM_ELEM_TYPE_FILE = 6, ///< 文件消息
|
||||
// V2TIM_ELEM_TYPE_LOCATION = 7, ///< 地理位置消息
|
||||
// V2TIM_ELEM_TYPE_FACE = 8, ///< 表情消息
|
||||
// V2TIM_ELEM_TYPE_GROUP_TIPS = 9, ///< 群 Tips 消息
|
||||
// V2TIM_ELEM_TYPE_MERGER = 10, ///< 合并消息
|
||||
|
||||
if (userInfoBean == null) {
|
||||
loadMyInfo();
|
||||
}
|
||||
|
||||
if (message.elemType ==1) {
|
||||
return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + message.textElem!.text! ?? '';
|
||||
} else if (message.elemType == 3) {
|
||||
return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一张图片';
|
||||
} else if (message.elemType == 4) {
|
||||
return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一条语音';
|
||||
} else if (message.elemType == 5) {
|
||||
return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一条视频';
|
||||
} else {
|
||||
return ((userInfoBean!.nickname! ?? '昵称待审核').isNotEmpty ? (userInfoBean!.nickname! ?? '昵称待审核') +':' : '') + '发了一条消息';
|
||||
}
|
||||
|
||||
},
|
||||
groupReadReceiptPermissionList: [
|
||||
GroupReceiptAllowType.work,
|
||||
GroupReceiptAllowType.meeting,
|
||||
@ -163,4 +199,16 @@ class _ChatPageState extends State<ChatPage> {
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
void loadMyInfo() async {
|
||||
var data = await DioManager.instance.get(url: Api.getUserMine);
|
||||
if (data['code'] == 200) {
|
||||
var bean = BaseResponse<MineResponseBean>.fromJson(
|
||||
data, (data) => MineResponseBean.fromJson(data));
|
||||
if (bean.isSuccess()) {
|
||||
userInfoBean = bean.data.user!;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin
|
||||
},
|
||||
child: ExitAppConfirmation(child: Stack(children: [
|
||||
Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
||||
bottomNavigationBar: Container(
|
||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||
|
||||
@ -20,17 +20,20 @@ class MsgPage extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: SafeArea(
|
||||
return Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: MediaQuery.of(context).size.width,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
fit: BoxFit.fill,
|
||||
image: AssetImage(getBaseImage('home_back')))),
|
||||
),
|
||||
SafeArea(
|
||||
child: GetBuilder(builder: (MsgLogic controller) {
|
||||
return Column(
|
||||
children: [
|
||||
@ -42,8 +45,10 @@ class MsgPage extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
));
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
navigatorItem() {
|
||||
@ -116,7 +121,6 @@ class MsgPage extends StatelessWidget {
|
||||
},
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
logic.listScrollController.animateTo(
|
||||
0.0,
|
||||
duration: Duration(milliseconds: 300),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user