mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-08 12:04:50 +08:00
handle msg type EN_MSG_TYPE_CUSTOM_FACE
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -178,6 +178,8 @@ class ChatItem extends StatelessWidget {
|
|||||||
return msgTypeText_1(theme, content: content, textColor: textColor);
|
return msgTypeText_1(theme, content: content, textColor: textColor);
|
||||||
case MsgType.EN_MSG_TYPE_PIC:
|
case MsgType.EN_MSG_TYPE_PIC:
|
||||||
return msgTypePic_2(content);
|
return msgTypePic_2(content);
|
||||||
|
case MsgType.EN_MSG_TYPE_CUSTOM_FACE:
|
||||||
|
return msgTypePic_2(content, showSize: false);
|
||||||
case MsgType.EN_MSG_TYPE_SHARE_V2:
|
case MsgType.EN_MSG_TYPE_SHARE_V2:
|
||||||
return msgTypeShareV2_7(content, textColor);
|
return msgTypeShareV2_7(content, textColor);
|
||||||
case MsgType.EN_MSG_TYPE_VIDEO_CARD:
|
case MsgType.EN_MSG_TYPE_VIDEO_CARD:
|
||||||
@@ -619,14 +621,16 @@ class ChatItem extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget msgTypePic_2(Map content) {
|
Widget msgTypePic_2(Map content, {bool showSize = true}) {
|
||||||
final url = content['url'];
|
final url = content['url'];
|
||||||
final imgWidth = (content['width'] as num).toDouble();
|
final imgWidth = (content['width'] as num).toDouble();
|
||||||
final imgHeight = (content['height'] as num).toDouble();
|
final imgHeight = (content['height'] as num).toDouble();
|
||||||
num? size;
|
num? size;
|
||||||
|
if (showSize) {
|
||||||
if (content['size'] case num value) {
|
if (content['size'] case num value) {
|
||||||
size = value * 1000;
|
size = value * 1000;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
final width = math.min(220.0, imgWidth);
|
final width = math.min(220.0, imgWidth);
|
||||||
final ratio = imgHeight / imgWidth;
|
final ratio = imgHeight / imgWidth;
|
||||||
Widget child = NetworkImgLayer(
|
Widget child = NetworkImgLayer(
|
||||||
|
|||||||
Reference in New Issue
Block a user