修改卡片消失
This commit is contained in:
parent
85925d3607
commit
5242ef0870
@ -1250,7 +1250,10 @@ class _MessageItem extends StatelessWidget {
|
||||
_isDuplicateCpInviteMessageForConversation(customData)) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
final cpRelationFormedCard = _cpRelationFormedMessageCard();
|
||||
final isCpInviteMessage =
|
||||
customData != null && _isCpInvitePayload(customData);
|
||||
final cpRelationFormedCard =
|
||||
isCpInviteMessage ? null : _cpRelationFormedMessageCard();
|
||||
final cpStatusLineText = _cpStatusLineTextForMessage();
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 15.w, vertical: 8.w),
|
||||
@ -1304,77 +1307,85 @@ class _MessageItem extends StatelessWidget {
|
||||
),
|
||||
child: cpRelationFormedCard,
|
||||
)
|
||||
else if (cpStatusLineText == null)
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
textDirection:
|
||||
message.isSelf! ? TextDirection.rtl : TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (isSystem) {
|
||||
return;
|
||||
}
|
||||
SCNavigatorUtils.push(
|
||||
context,
|
||||
replace:
|
||||
AccountStorage().getCurrentUser()?.userProfile?.id !=
|
||||
message.sender,
|
||||
"${SCMainRoute.person}?isMe=${AccountStorage().getCurrentUser()?.userProfile?.id == message.sender}&tageId=${message.sender}",
|
||||
);
|
||||
},
|
||||
child:
|
||||
message.sender == "administrator" ||
|
||||
message.sender == "customer"
|
||||
? ExtendedImage.asset(
|
||||
_strategy.getSCMessageChatPageSystemHeadImage(),
|
||||
width: 45.w,
|
||||
shape: BoxShape.circle,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: netImage(
|
||||
url:
|
||||
message.isSelf!
|
||||
? (me?.userAvatar ?? "")
|
||||
: (friend?.userAvatar ?? ""),
|
||||
shape: BoxShape.circle,
|
||||
width: width(45),
|
||||
),
|
||||
),
|
||||
// 他人消息的阴影间隔是10dp
|
||||
Container(width: 8.w),
|
||||
Row(
|
||||
textDirection:
|
||||
message.isSelf! ? TextDirection.rtl : TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
alignment:
|
||||
message.isSelf!
|
||||
? AlignmentDirectional.topEnd
|
||||
: AlignmentDirectional.topStart,
|
||||
margin: EdgeInsets.only(top: 4.w),
|
||||
child: _msg(),
|
||||
),
|
||||
SizedBox(width: 6.w),
|
||||
Visibility(
|
||||
visible:
|
||||
message.status ==
|
||||
MessageStatus.V2TIM_MSG_STATUS_SENDING,
|
||||
child: CupertinoActivityIndicator(),
|
||||
),
|
||||
else if (cpStatusLineText == null || isCpInviteMessage)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: cpStatusLineText == null ? 0 : 10.w,
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
textDirection:
|
||||
message.isSelf! ? TextDirection.rtl : TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
if (isSystem) {
|
||||
return;
|
||||
}
|
||||
SCNavigatorUtils.push(
|
||||
context,
|
||||
replace:
|
||||
AccountStorage()
|
||||
.getCurrentUser()
|
||||
?.userProfile
|
||||
?.id !=
|
||||
message.sender,
|
||||
"${SCMainRoute.person}?isMe=${AccountStorage().getCurrentUser()?.userProfile?.id == message.sender}&tageId=${message.sender}",
|
||||
);
|
||||
},
|
||||
child:
|
||||
message.sender == "administrator" ||
|
||||
message.sender == "customer"
|
||||
? ExtendedImage.asset(
|
||||
_strategy.getSCMessageChatPageSystemHeadImage(),
|
||||
width: 45.w,
|
||||
shape: BoxShape.circle,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: netImage(
|
||||
url:
|
||||
message.isSelf!
|
||||
? (me?.userAvatar ?? "")
|
||||
: (friend?.userAvatar ?? ""),
|
||||
shape: BoxShape.circle,
|
||||
width: width(45),
|
||||
),
|
||||
),
|
||||
// 他人消息的阴影间隔是10dp
|
||||
Container(width: 8.w),
|
||||
Row(
|
||||
textDirection:
|
||||
message.isSelf! ? TextDirection.rtl : TextDirection.ltr,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
alignment:
|
||||
message.isSelf!
|
||||
? AlignmentDirectional.topEnd
|
||||
: AlignmentDirectional.topStart,
|
||||
margin: EdgeInsets.only(top: 4.w),
|
||||
child: _msg(),
|
||||
),
|
||||
SizedBox(width: 6.w),
|
||||
Visibility(
|
||||
visible:
|
||||
message.status ==
|
||||
MessageStatus.V2TIM_MSG_STATUS_SENDING,
|
||||
child: CupertinoActivityIndicator(),
|
||||
),
|
||||
|
||||
Visibility(
|
||||
visible:
|
||||
message.status ==
|
||||
MessageStatus.V2TIM_MSG_STATUS_SEND_FAIL,
|
||||
child: Icon(Icons.error, color: Colors.red),
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
Visibility(
|
||||
visible:
|
||||
message.status ==
|
||||
MessageStatus.V2TIM_MSG_STATUS_SEND_FAIL,
|
||||
child: Icon(Icons.error, color: Colors.red),
|
||||
),
|
||||
],
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user