修改聊天卡片UI,卡片圈子点击
This commit is contained in:
parent
5a1ffc90e3
commit
ac526afef6
@ -3,6 +3,7 @@ import 'dart:math';
|
|||||||
|
|
||||||
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_text_elem.dart';
|
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_chat_text_elem.dart';
|
||||||
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_merger_message_elem.dart';
|
import 'package:circle_app/app/chat/TIMUIKitChat/TIMUIKitMessageItem/tim_uikit_merger_message_elem.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/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
@ -402,11 +403,10 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
if (messageItem.customElem?.extension?.contains('cardData') ?? false) {
|
if (messageItem.customElem?.extension?.contains('cardData') ?? false) {
|
||||||
Map info = jsonDecode(messageItem.customElem?.data ?? '');
|
Map info = jsonDecode(messageItem.customElem?.data ?? '');
|
||||||
return Container(
|
return Container(
|
||||||
height: info.containsKey('city') ? 175 : 140,
|
height: info.containsKey('city') ? 175.sp : 135.sp,
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
|
margin: EdgeInsets.only(left: isFromSelf ? 16 : 0, right: isFromSelf ? 0 : 16),
|
||||||
margin: EdgeInsets.only(left: 20),
|
decoration: BoxDecoration(
|
||||||
decoration: BoxDecoration(
|
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(
|
image: AssetImage(
|
||||||
@ -415,43 +415,78 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(left: 12,right: 12),
|
padding: EdgeInsets.only(left: 12.sp, right: 12.sp),
|
||||||
// height: 60,
|
// height: 60,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
if (info.containsKey('city'))
|
if (info.containsKey('city'))
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 10),
|
margin: EdgeInsets.only(top: 10.sp),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(right: 5),width: 3,height: 3,decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.5),color: Color(0xFF00FFF4)),),
|
margin: EdgeInsets.only(right: 5.sp),
|
||||||
Text(info['city'],style: TextStyle(color: Colors.white,fontSize: 14,fontWeight: FontWeight.w500),)
|
width: 3.sp,
|
||||||
|
height: 3.sp,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(1.5.sp),
|
||||||
|
color: Color(0xFF00FFF4)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
info['city'],
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 14.sp,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (info.containsKey('both_interests'))
|
if (info.containsKey('both_interests'))
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 16),
|
margin: EdgeInsets.only(top: 16.sp),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(right: 5),width: 3,height: 3,decoration: BoxDecoration(borderRadius: BorderRadius.circular(1.5),color: Color(0xFF00FFF4)),),
|
margin: EdgeInsets.only(right: 5.sp),
|
||||||
Text(info['both_interests'],style: TextStyle(color: Colors.white,fontSize: 14,fontWeight: FontWeight.w500),)
|
width: 3,
|
||||||
|
height: 3,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(1.5),
|
||||||
|
color: Color(0xFF00FFF4)),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
info['both_interests'],
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 14.sp,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(top: 10,bottom: 10),
|
margin: EdgeInsets.only(top: 10.sp, bottom: 10.sp),
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: Text(isFromSelf ? info['user']['signature'] : info['my']['signature'],style: TextStyle(color: Colors.white,fontSize: 14,fontWeight: FontWeight.w500),maxLines: 2,overflow: TextOverflow.ellipsis,),
|
child: Text(
|
||||||
|
isFromSelf
|
||||||
|
? info['user']['signature']
|
||||||
|
: info['my']['signature'],
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 14.sp,
|
||||||
|
fontWeight: FontWeight.w500),
|
||||||
|
maxLines: 2,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
getCircleImage('line'),
|
getCircleImage('line'),
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
interestWdiget(isFromSelf ? info['interests'] : info['myInterests'])
|
interestWdiget(
|
||||||
|
isFromSelf ? info['interests'] : info['myInterests'])
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
@ -460,7 +495,6 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return TIMUIKitCustomElem(
|
return TIMUIKitCustomElem(
|
||||||
message: messageItem,
|
message: messageItem,
|
||||||
customElem: messageItem.customElem,
|
customElem: messageItem.customElem,
|
||||||
@ -656,41 +690,47 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
itemCount: data.length,
|
itemCount: data.length,
|
||||||
padding: EdgeInsets.symmetric(vertical: 11.sp),
|
padding: EdgeInsets.symmetric(vertical: 11.sp),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Container(
|
return GestureDetector(
|
||||||
margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距
|
onTap: () {
|
||||||
|
Get.toNamed(AppRoutes.Signal_circle_list,
|
||||||
|
arguments: data[index]['id']);
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
margin: EdgeInsets.only(right: 11.sp), // 替换为实际的 item 间距
|
||||||
borderRadius: BorderRadius.circular(17.0), // 设置圆角半径
|
|
||||||
gradient: LinearGradient(
|
|
||||||
colors: [
|
|
||||||
Color(0xFF06F9FA),
|
|
||||||
Color(0xFFDC5BFD),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
color: Color(0xFF392D53),
|
|
||||||
),
|
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.all(0.5.sp),
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(17.0),
|
borderRadius: BorderRadius.circular(17.0), // 设置圆角半径
|
||||||
// shape: BoxShape.circle,
|
gradient: LinearGradient(
|
||||||
|
colors: [
|
||||||
|
Color(0xFF06F9FA),
|
||||||
|
Color(0xFFDC5BFD),
|
||||||
|
],
|
||||||
|
),
|
||||||
color: Color(0xFF392D53),
|
color: Color(0xFF392D53),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Container(
|
||||||
padding: EdgeInsets.only(
|
margin: EdgeInsets.all(0.5.sp),
|
||||||
top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp),
|
decoration: BoxDecoration(
|
||||||
child: Center(
|
borderRadius: BorderRadius.circular(17.0),
|
||||||
child: Text(
|
// shape: BoxShape.circle,
|
||||||
data[index]['title'],
|
color: Color(0xFF392D53),
|
||||||
style: TextStyle(
|
),
|
||||||
fontSize: 11.0,
|
child: Padding(
|
||||||
color: Colors.white,
|
padding: EdgeInsets.only(
|
||||||
|
top: 2.sp, bottom: 2.sp, left: 15.sp, right: 15.sp),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
data[index]['title'],
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 11.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
), // 替换为实际的列表项小部件
|
||||||
), // 替换为实际的列表项小部件
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -1114,7 +1154,6 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
context, widget.message, model, theme, details, true, false);
|
context, widget.message, model, theme, details, true, false);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1308,7 +1347,8 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
children: [
|
children: [
|
||||||
if (model.isMultiSelect)
|
if (model.isMultiSelect)
|
||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(right: 12, top: 10, left: isSelf ? 16 : 0),
|
margin:
|
||||||
|
EdgeInsets.only(right: 12, top: 10, left: isSelf ? 16 : 0),
|
||||||
child: CheckBoxButton(
|
child: CheckBoxButton(
|
||||||
isChecked: model.multiSelectedMessageList.contains(message),
|
isChecked: model.multiSelectedMessageList.contains(message),
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
@ -1350,225 +1390,251 @@ class _TIMUIKItHistoryMessageListItemState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child:
|
child: (message.customElem?.extension?.contains('cardData') ??
|
||||||
(message.customElem?.extension?.contains('cardData') ?? false) ? _getMessageItemBuilder(message, 1, model) : Row(
|
false)
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
? _getMessageItemBuilder(message, 1, model)
|
||||||
mainAxisAlignment: isSelf
|
: Row(
|
||||||
? MainAxisAlignment.end
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
: MainAxisAlignment.start,
|
mainAxisAlignment: isSelf
|
||||||
children: [
|
? MainAxisAlignment.end
|
||||||
|
: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (!isSelf && widget.showAvatar)
|
||||||
if (!isSelf && widget.showAvatar)
|
InkWell(
|
||||||
InkWell(
|
onLongPress: () {
|
||||||
onLongPress: () {
|
if (widget.onLongPressForOthersHeadPortrait !=
|
||||||
if (widget.onLongPressForOthersHeadPortrait !=
|
null) {}
|
||||||
null) {}
|
if (model
|
||||||
if (model.chatConfig.isAllowLongPressAvatarToAt) {
|
.chatConfig.isAllowLongPressAvatarToAt) {
|
||||||
widget.onLongPressForOthersHeadPortrait!(
|
widget.onLongPressForOthersHeadPortrait!(
|
||||||
message.sender, message.nickName);
|
message.sender, message.nickName);
|
||||||
}
|
|
||||||
},
|
|
||||||
onTapDown: isDesktopScreen
|
|
||||||
? (details) {
|
|
||||||
if (widget.onTapForOthersPortrait != null &&
|
|
||||||
widget.allowAvatarTap) {
|
|
||||||
widget.onTapForOthersPortrait!(
|
|
||||||
message.sender ?? "", details);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
onTap: isDesktopScreen
|
|
||||||
? null
|
|
||||||
: () {
|
|
||||||
if (widget.onTapForOthersPortrait != null &&
|
|
||||||
widget.allowAvatarTap) {
|
|
||||||
widget.onTapForOthersPortrait!(
|
|
||||||
message.sender ?? "", TapDownDetails());
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: widget.userAvatarBuilder != null
|
onTapDown: isDesktopScreen
|
||||||
? widget.userAvatarBuilder!(context, message)
|
? (details) {
|
||||||
: Container(
|
if (widget.onTapForOthersPortrait !=
|
||||||
margin: (isSelf && isShowNickNameForSelf) ||
|
null &&
|
||||||
(!isSelf && isShowNickNameForOthers)
|
widget.allowAvatarTap) {
|
||||||
? const EdgeInsets.only(top: 2)
|
widget.onTapForOthersPortrait!(
|
||||||
: null,
|
message.sender ?? "", details);
|
||||||
child: SizedBox(
|
}
|
||||||
width: 40,
|
}
|
||||||
height: 40,
|
: null,
|
||||||
child: Avatar(
|
onTap: isDesktopScreen
|
||||||
faceUrl: message.faceUrl ?? "",
|
? null
|
||||||
showName:
|
: () {
|
||||||
MessageUtils.getDisplayName(message),
|
if (widget.onTapForOthersPortrait !=
|
||||||
),
|
null &&
|
||||||
),
|
widget.allowAvatarTap) {
|
||||||
),
|
widget.onTapForOthersPortrait!(
|
||||||
),
|
message.sender ?? "",
|
||||||
Container(
|
TapDownDetails());
|
||||||
margin: widget.showAvatar
|
}
|
||||||
? (isSelf
|
},
|
||||||
? const EdgeInsets.only(right: 13)
|
child: widget.userAvatarBuilder != null
|
||||||
: const EdgeInsets.only(left: 13))
|
? widget.userAvatarBuilder!(
|
||||||
: null,
|
context, message)
|
||||||
child: Column(
|
: Container(
|
||||||
crossAxisAlignment: isSelf
|
margin:
|
||||||
? CrossAxisAlignment.end
|
(isSelf && isShowNickNameForSelf) ||
|
||||||
: CrossAxisAlignment.start,
|
(!isSelf &&
|
||||||
children: [
|
isShowNickNameForOthers)
|
||||||
if ((isSelf && isShowNickNameForSelf) ||
|
? const EdgeInsets.only(top: 2)
|
||||||
(!isSelf && isShowNickNameForOthers))
|
: null,
|
||||||
widget.topRowBuilder != null
|
child: SizedBox(
|
||||||
? widget.topRowBuilder!(context, message)
|
width: 40,
|
||||||
: Container(
|
height: 40,
|
||||||
margin: const EdgeInsets.only(bottom: 4),
|
child: Avatar(
|
||||||
child: ConstrainedBox(
|
faceUrl: message.faceUrl ?? "",
|
||||||
|
showName:
|
||||||
|
MessageUtils.getDisplayName(
|
||||||
|
message),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: widget.showAvatar
|
||||||
|
? (isSelf
|
||||||
|
? const EdgeInsets.only(right: 13)
|
||||||
|
: const EdgeInsets.only(left: 13))
|
||||||
|
: null,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: isSelf
|
||||||
|
? CrossAxisAlignment.end
|
||||||
|
: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if ((isSelf && isShowNickNameForSelf) ||
|
||||||
|
(!isSelf && isShowNickNameForOthers))
|
||||||
|
widget.topRowBuilder != null
|
||||||
|
? widget.topRowBuilder!(
|
||||||
|
context, message)
|
||||||
|
: Container(
|
||||||
|
margin: const EdgeInsets.only(
|
||||||
|
bottom: 4),
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
maxWidth:
|
||||||
|
MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
1.7),
|
||||||
|
child: Text(
|
||||||
|
MessageUtils.getDisplayName(
|
||||||
|
message),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: widget.themeData
|
||||||
|
?.nickNameTextStyle ??
|
||||||
|
TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: theme
|
||||||
|
.weakTextColor),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
if (isSelf && message.elemType != 2)
|
||||||
|
renderHoverTipAndReadStatus(model,
|
||||||
|
isSelf, message, isPeerRead, theme),
|
||||||
|
Container(
|
||||||
constraints: BoxConstraints(
|
constraints: BoxConstraints(
|
||||||
maxWidth: MediaQuery.of(context)
|
maxWidth: constraints.maxWidth * 0.77,
|
||||||
.size
|
|
||||||
.width /
|
|
||||||
1.7),
|
|
||||||
child: Text(
|
|
||||||
MessageUtils.getDisplayName(message),
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: widget.themeData
|
|
||||||
?.nickNameTextStyle ??
|
|
||||||
TextStyle(
|
|
||||||
fontSize: 12,
|
|
||||||
color: theme.weakTextColor),
|
|
||||||
),
|
),
|
||||||
)),
|
child: Builder(builder: (context) {
|
||||||
Row(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment:
|
||||||
children: [
|
(message.isSelf ?? true)
|
||||||
if (isSelf && message.elemType != 2)
|
? CrossAxisAlignment.end
|
||||||
renderHoverTipAndReadStatus(model, isSelf,
|
: CrossAxisAlignment.start,
|
||||||
message, isPeerRead, theme),
|
children: [
|
||||||
Container(
|
GestureDetector(
|
||||||
constraints: BoxConstraints(
|
child: IgnorePointer(
|
||||||
maxWidth: constraints.maxWidth * 0.77,
|
ignoring:
|
||||||
|
model.isMultiSelect,
|
||||||
|
child:
|
||||||
|
_getMessageItemBuilder(
|
||||||
|
message,
|
||||||
|
message.status,
|
||||||
|
model)),
|
||||||
|
onSecondaryTapDown: (details) {
|
||||||
|
if (widget.onLongPress !=
|
||||||
|
null) {
|
||||||
|
widget.onLongPress!(
|
||||||
|
context, message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!PlatformUtils()
|
||||||
|
.isMobile) {
|
||||||
|
if (widget.allowLongPress) {
|
||||||
|
_onOpenToolTip(
|
||||||
|
context,
|
||||||
|
message,
|
||||||
|
model,
|
||||||
|
theme,
|
||||||
|
details,
|
||||||
|
false,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLongPress: () {
|
||||||
|
if (widget.onLongPress !=
|
||||||
|
null) {
|
||||||
|
widget.onLongPress!(
|
||||||
|
context, message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (widget.allowLongPress &&
|
||||||
|
PlatformUtils()
|
||||||
|
.isMobile) {
|
||||||
|
_onOpenToolTip(
|
||||||
|
context,
|
||||||
|
message,
|
||||||
|
model,
|
||||||
|
theme,
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onTapDown: (details) {
|
||||||
|
_tapDetails = details;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TIMUIKitTextTranslationElem(
|
||||||
|
message: message,
|
||||||
|
isUseDefaultEmoji:
|
||||||
|
widget.isUseDefaultEmoji,
|
||||||
|
customEmojiStickerList: widget
|
||||||
|
.customEmojiStickerList,
|
||||||
|
isFromSelf:
|
||||||
|
message.isSelf ?? true,
|
||||||
|
isShowJump: false,
|
||||||
|
clearJump: () {},
|
||||||
|
chatModel: model)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
if (!isSelf &&
|
||||||
|
message.elemType ==
|
||||||
|
MessageElemType
|
||||||
|
.V2TIM_ELEM_TYPE_SOUND &&
|
||||||
|
message.localCustomInt != null &&
|
||||||
|
message.localCustomInt !=
|
||||||
|
HistoryMessageDartConstant.read)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 5, bottom: 12),
|
||||||
|
child: Icon(Icons.circle,
|
||||||
|
color: theme.cautionColor,
|
||||||
|
size: 10)),
|
||||||
|
if (!isSelf && message.elemType != 2)
|
||||||
|
renderHoverTipAndReadStatus(model,
|
||||||
|
isSelf, message, isPeerRead, theme),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
child: Builder(builder: (context) {
|
if (widget.bottomRowBuilder != null)
|
||||||
return Column(
|
widget.bottomRowBuilder!(context, message)
|
||||||
crossAxisAlignment:
|
],
|
||||||
(message.isSelf ?? true)
|
),
|
||||||
? CrossAxisAlignment.end
|
|
||||||
: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
child: IgnorePointer(
|
|
||||||
ignoring: model.isMultiSelect,
|
|
||||||
child: _getMessageItemBuilder(
|
|
||||||
message,
|
|
||||||
message.status,
|
|
||||||
model)),
|
|
||||||
onSecondaryTapDown: (details) {
|
|
||||||
if (widget.onLongPress != null) {
|
|
||||||
widget.onLongPress!(
|
|
||||||
context, message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!PlatformUtils().isMobile) {
|
|
||||||
if (widget.allowLongPress) {
|
|
||||||
_onOpenToolTip(
|
|
||||||
context,
|
|
||||||
message,
|
|
||||||
model,
|
|
||||||
theme,
|
|
||||||
details,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onLongPress: () {
|
|
||||||
if (widget.onLongPress != null) {
|
|
||||||
widget.onLongPress!(
|
|
||||||
context, message);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (widget.allowLongPress &&
|
|
||||||
PlatformUtils().isMobile) {
|
|
||||||
_onOpenToolTip(
|
|
||||||
context,
|
|
||||||
message,
|
|
||||||
model,
|
|
||||||
theme,
|
|
||||||
null,
|
|
||||||
false,
|
|
||||||
false);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onTapDown: (details) {
|
|
||||||
_tapDetails = details;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TIMUIKitTextTranslationElem(
|
|
||||||
message: message,
|
|
||||||
isUseDefaultEmoji:
|
|
||||||
widget.isUseDefaultEmoji,
|
|
||||||
customEmojiStickerList:
|
|
||||||
widget.customEmojiStickerList,
|
|
||||||
isFromSelf: message.isSelf ?? true,
|
|
||||||
isShowJump: false,
|
|
||||||
clearJump: () {},
|
|
||||||
chatModel: model)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
if (!isSelf &&
|
|
||||||
message.elemType ==
|
|
||||||
MessageElemType.V2TIM_ELEM_TYPE_SOUND &&
|
|
||||||
message.localCustomInt != null &&
|
|
||||||
message.localCustomInt !=
|
|
||||||
HistoryMessageDartConstant.read)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(
|
|
||||||
left: 5, bottom: 12),
|
|
||||||
child: Icon(Icons.circle,
|
|
||||||
color: theme.cautionColor, size: 10)),
|
|
||||||
if (!isSelf && message.elemType != 2)
|
|
||||||
renderHoverTipAndReadStatus(model, isSelf,
|
|
||||||
message, isPeerRead, theme),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
if (widget.bottomRowBuilder != null)
|
if (widget.message.elemType == 6 &&
|
||||||
widget.bottomRowBuilder!(context, message)
|
isDownloadWaiting)
|
||||||
],
|
Container(
|
||||||
),
|
margin: const EdgeInsets.only(top: 24, left: 6),
|
||||||
),
|
child: LoadingAnimationWidget.threeArchedCircle(
|
||||||
if (widget.message.elemType == 6 && isDownloadWaiting)
|
color: theme.weakTextColor ?? Colors.grey,
|
||||||
Container(
|
size: 20,
|
||||||
margin: const EdgeInsets.only(top: 24, left: 6),
|
|
||||||
child: LoadingAnimationWidget.threeArchedCircle(
|
|
||||||
color: theme.weakTextColor ?? Colors.grey,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (isSelf && widget.showAvatar && message.elemType != 2)
|
|
||||||
widget.userAvatarBuilder != null
|
|
||||||
? widget.userAvatarBuilder!(context, message)
|
|
||||||
: SizedBox(
|
|
||||||
width: 40,
|
|
||||||
height: 40,
|
|
||||||
child: InkWell(
|
|
||||||
onTapDown: (details) {
|
|
||||||
if (widget.onTapForOthersPortrait != null &&
|
|
||||||
widget.allowAvatarTap) {
|
|
||||||
widget.onTapForOthersPortrait!(
|
|
||||||
message.sender ?? "", details);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Avatar(
|
|
||||||
faceUrl: message.faceUrl ?? "",
|
|
||||||
showName:
|
|
||||||
MessageUtils.getDisplayName(message)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
if (isSelf &&
|
||||||
),
|
widget.showAvatar &&
|
||||||
|
message.elemType != 2)
|
||||||
|
widget.userAvatarBuilder != null
|
||||||
|
? widget.userAvatarBuilder!(context, message)
|
||||||
|
: SizedBox(
|
||||||
|
width: 40,
|
||||||
|
height: 40,
|
||||||
|
child: InkWell(
|
||||||
|
onTapDown: (details) {
|
||||||
|
if (widget.onTapForOthersPortrait !=
|
||||||
|
null &&
|
||||||
|
widget.allowAvatarTap) {
|
||||||
|
widget.onTapForOthersPortrait!(
|
||||||
|
message.sender ?? "", details);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: Avatar(
|
||||||
|
faceUrl: message.faceUrl ?? "",
|
||||||
|
showName:
|
||||||
|
MessageUtils.getDisplayName(
|
||||||
|
message)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,7 +1,44 @@
|
|||||||
|
import 'package:circle_app/app/circle/logic.dart';
|
||||||
|
import 'package:circle_app/network/api.dart';
|
||||||
|
import 'package:circle_app/network/dio_manager.dart';
|
||||||
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'state.dart';
|
import 'state.dart';
|
||||||
|
|
||||||
class Signal_circle_listLogic extends GetxController {
|
class Signal_circle_listLogic extends GetxController {
|
||||||
final Signal_circle_listState state = Signal_circle_listState();
|
final Signal_circle_listState state = Signal_circle_listState();
|
||||||
|
|
||||||
|
Circle? circle;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
loadData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadData() async {
|
||||||
|
var data = await DioManager.instance
|
||||||
|
.get(url: 'up-service/interest/${Get.arguments}');
|
||||||
|
if (data['code'] == 200) {
|
||||||
|
circle = Circle.fromJson(data['data']);
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
outCircle(String interest_id, bool isStatus) async {
|
||||||
|
var data = await DioManager.instance.post(
|
||||||
|
url: Api.outCrrcle + interest_id + "/join",
|
||||||
|
params: {"status": isStatus ? "0" : "1"});
|
||||||
|
var bean = BaseResponse<String>.fromJson(data, (data) => data);
|
||||||
|
if (bean.code == 200) {
|
||||||
|
|
||||||
|
circle!.isJoin = !isStatus;
|
||||||
|
update();
|
||||||
|
|
||||||
|
}
|
||||||
|
showToast(bean.msg);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:circle_app/app/circle/widgets/info_list_view.dart';
|
|||||||
import 'package:circle_app/components/my_app_bar.dart';
|
import 'package:circle_app/components/my_app_bar.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:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@ -15,8 +16,7 @@ class Signal_circle_listPage extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
return Container(
|
|
||||||
width: MediaQuery.of(context).size.width,
|
width: MediaQuery.of(context).size.width,
|
||||||
height: MediaQuery.of(context).size.height,
|
height: MediaQuery.of(context).size.height,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -24,34 +24,32 @@ class Signal_circle_listPage extends StatelessWidget {
|
|||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(getBaseImage('home_back')))),
|
image: AssetImage(getBaseImage('home_back')))),
|
||||||
child: Scaffold(
|
child: GetBuilder(builder: (Signal_circle_listLogic controller) {
|
||||||
backgroundColor: Colors.transparent,
|
return Scaffold(
|
||||||
body: SafeArea(
|
backgroundColor: Colors.transparent,
|
||||||
child: GetBuilder(builder: (Signal_circle_listLogic controller) {
|
appBar: MyAppBar(
|
||||||
return Stack(
|
centerTitle: logic.circle?.title ?? '',
|
||||||
children: [
|
),
|
||||||
Container(
|
body: Container(
|
||||||
width: MediaQuery.of(context).size.width,
|
padding: EdgeInsets.only(left: 15.sp, right: 15.sp),
|
||||||
height: MediaQuery.of(context).size.height,
|
width: MediaQuery.of(context).size.width,
|
||||||
child: Column(children: [
|
height: MediaQuery.of(context).size.height,
|
||||||
backNavigatorItem(),
|
child: Column(children: [
|
||||||
// Text(controller.state.msg),
|
// backNavigatorItem(),
|
||||||
//组件使用
|
// Text(controller.state.msg),
|
||||||
// Expanded(
|
//组件使用
|
||||||
// child: InfoListView(0, Circle(id: Get.arguments['id']), controller));
|
Expanded(
|
||||||
]),
|
child: controller.circle == null
|
||||||
),
|
? loaddingWidget(true)
|
||||||
],
|
: InfoListView(0, controller.circle!, controller))
|
||||||
);
|
]),
|
||||||
}),
|
));
|
||||||
),
|
}));
|
||||||
));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
backNavigatorItem() {
|
|
||||||
return MyAppBar(
|
|
||||||
centerTitle: Get.arguments['title'],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// backNavigatorItem() {
|
||||||
|
// return MyAppBar(
|
||||||
|
// centerTitle: ,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,6 +44,8 @@ import 'package:circle_app/app/setup/binding.dart';
|
|||||||
import 'package:circle_app/app/setup/view.dart';
|
import 'package:circle_app/app/setup/view.dart';
|
||||||
import 'package:circle_app/app/login/complete_material/binding.dart';
|
import 'package:circle_app/app/login/complete_material/binding.dart';
|
||||||
import 'package:circle_app/app/login/complete_material/view.dart';
|
import 'package:circle_app/app/login/complete_material/view.dart';
|
||||||
|
import 'package:circle_app/app/signal_circle_list/binding.dart';
|
||||||
|
import 'package:circle_app/app/signal_circle_list/view.dart';
|
||||||
import 'package:circle_app/app/splash/binding.dart';
|
import 'package:circle_app/app/splash/binding.dart';
|
||||||
import 'package:circle_app/app/swiper/binding.dart';
|
import 'package:circle_app/app/swiper/binding.dart';
|
||||||
import 'package:circle_app/app/swiper/view.dart';
|
import 'package:circle_app/app/swiper/view.dart';
|
||||||
@ -207,5 +209,11 @@ class AppPages {
|
|||||||
page: () => PrivacyPage(),
|
page: () => PrivacyPage(),
|
||||||
binding: PrivacyBinding(),
|
binding: PrivacyBinding(),
|
||||||
),
|
),
|
||||||
|
GetPage(
|
||||||
|
name: AppRoutes.Signal_circle_list,
|
||||||
|
page: () => Signal_circle_listPage(),
|
||||||
|
binding: Signal_circle_listBinding(),
|
||||||
|
),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,8 @@ abstract class AppRoutes {
|
|||||||
|
|
||||||
static const PrivacyActivity = '/user/PrivacyActivity';
|
static const PrivacyActivity = '/user/PrivacyActivity';
|
||||||
|
|
||||||
|
static const Signal_circle_list = '/msg/chat/signal_circle_list';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user