修改推送昵称无法显示、聊天页面有键盘返回页面底部白屏bug
This commit is contained in:
parent
696400d98f
commit
76969fa785
@ -379,7 +379,7 @@ class _TUIChatState extends TIMUIKitState<TIMChat> {
|
|||||||
},
|
},
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
backgroundColor: Colors.transparent,
|
backgroundColor: Colors.transparent,
|
||||||
resizeToAvoidBottomInset: false,
|
// resizeToAvoidBottomInset: false,
|
||||||
appBar:PreferredSize(
|
appBar:PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(48.0),
|
preferredSize: const Size.fromHeight(48.0),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
|
|||||||
@ -1,11 +1,15 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
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/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/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/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.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/tencent_cloud_chat_uikit.dart';
|
||||||
import 'package:tencent_cloud_chat_uikit/ui/controller/tim_uikit_chat_controller.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 =
|
final TIMUIKitChatController _timuiKitChatController =
|
||||||
TIMUIKitChatController();
|
TIMUIKitChatController();
|
||||||
|
|
||||||
|
User? userInfoBean;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
// TODO: implement initState
|
||||||
super.initState();
|
super.initState();
|
||||||
initEventBus();
|
initEventBus();
|
||||||
|
loadMyInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -106,7 +113,7 @@ class _ChatPageState extends State<ChatPage> {
|
|||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
controller : _timuiKitChatController,
|
controller : _timuiKitChatController,
|
||||||
config: const TIMUIKitChatConfig(
|
config: TIMUIKitChatConfig(
|
||||||
// 仅供演示,非全部配置项,实际使用中,可只传和默认项不同的参数,无需传入所有开关
|
// 仅供演示,非全部配置项,实际使用中,可只传和默认项不同的参数,无需传入所有开关
|
||||||
isAllowClickAvatar: true,
|
isAllowClickAvatar: true,
|
||||||
isUseDefaultEmoji: true,
|
isUseDefaultEmoji: true,
|
||||||
@ -116,7 +123,36 @@ class _ChatPageState extends State<ChatPage> {
|
|||||||
notificationTitle: "",
|
notificationTitle: "",
|
||||||
isUseMessageReaction: true,
|
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: [
|
groupReadReceiptPermissionList: [
|
||||||
GroupReceiptAllowType.work,
|
GroupReceiptAllowType.work,
|
||||||
GroupReceiptAllowType.meeting,
|
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: [
|
child: ExitAppConfirmation(child: Stack(children: [
|
||||||
Scaffold(
|
Scaffold(
|
||||||
|
resizeToAvoidBottomInset: false,
|
||||||
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
// backgroundColor: Color.fromRGBO(244, 245, 245, 1.0),
|
||||||
bottomNavigationBar: Container(
|
bottomNavigationBar: Container(
|
||||||
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
height: 49.sp + MediaQuery.of(context).padding.bottom,
|
||||||
|
|||||||
@ -20,17 +20,20 @@ class MsgPage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Scaffold(
|
||||||
width: MediaQuery.of(context).size.width,
|
resizeToAvoidBottomInset: false,
|
||||||
height: MediaQuery.of(context).size.height,
|
backgroundColor: Colors.transparent,
|
||||||
decoration: BoxDecoration(
|
body: Stack(
|
||||||
image: DecorationImage(
|
children: [
|
||||||
fit: BoxFit.fill,
|
Container(
|
||||||
image: AssetImage(getBaseImage('home_back')))),
|
width: MediaQuery.of(context).size.width,
|
||||||
child: Scaffold(
|
height: MediaQuery.of(context).size.height,
|
||||||
resizeToAvoidBottomInset: false,
|
decoration: BoxDecoration(
|
||||||
backgroundColor: Colors.transparent,
|
image: DecorationImage(
|
||||||
body: SafeArea(
|
fit: BoxFit.fill,
|
||||||
|
image: AssetImage(getBaseImage('home_back')))),
|
||||||
|
),
|
||||||
|
SafeArea(
|
||||||
child: GetBuilder(builder: (MsgLogic controller) {
|
child: GetBuilder(builder: (MsgLogic controller) {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
@ -42,8 +45,10 @@ class MsgPage extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
),
|
)
|
||||||
));
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
navigatorItem() {
|
navigatorItem() {
|
||||||
@ -116,7 +121,6 @@ class MsgPage extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
|
||||||
logic.listScrollController.animateTo(
|
logic.listScrollController.animateTo(
|
||||||
0.0,
|
0.0,
|
||||||
duration: Duration(milliseconds: 300),
|
duration: Duration(milliseconds: 300),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user