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