mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
chore: code clean up
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -39,8 +39,8 @@ class WhisperDetailController extends GetxController {
|
||||
if (messageList.length == 1 &&
|
||||
messageList.last.msgType == 18 &&
|
||||
messageList.last.msgSource == 18) {
|
||||
// print(messageList.last);
|
||||
// print(messageList.last.content);
|
||||
// debugPrint(messageList.last);
|
||||
// debugPrint(messageList.last.content);
|
||||
//{content: [{"text":"对方主动回复或关注你前,最多发送1条消息","color_day":"#9499A0","color_nig":"#9499A0"}]}
|
||||
} else {
|
||||
ackSessionMsg();
|
||||
@@ -96,7 +96,7 @@ class WhisperDetailController extends GetxController {
|
||||
msgType: picMsg != null ? 2 : 1,
|
||||
);
|
||||
if (result['status']) {
|
||||
// print(result['data']);
|
||||
// debugPrint(result['data']);
|
||||
querySessionMsg();
|
||||
replyContentController.text = "";
|
||||
SmartDialog.dismiss();
|
||||
|
||||
@@ -163,7 +163,7 @@ class _WhisperDetailPageState extends State<WhisperDetailPage> {
|
||||
itemBuilder: (_, int i) {
|
||||
return ChatItem(
|
||||
item: messageList[i],
|
||||
e_infos: _whisperDetailController.eInfos,
|
||||
eInfos: _whisperDetailController.eInfos,
|
||||
);
|
||||
},
|
||||
padding: const EdgeInsets.only(bottom: 20),
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// ignore_for_file: must_be_immutable
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -40,13 +38,13 @@ enum MsgType {
|
||||
}
|
||||
|
||||
class ChatItem extends StatelessWidget {
|
||||
dynamic item;
|
||||
List? e_infos;
|
||||
final dynamic item;
|
||||
final List? eInfos;
|
||||
|
||||
ChatItem({
|
||||
const ChatItem({
|
||||
super.key,
|
||||
this.item,
|
||||
this.e_infos,
|
||||
this.eInfos,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -55,11 +53,11 @@ class ChatItem extends StatelessWidget {
|
||||
item.senderUid == GStorage.userInfo.get('userInfoCache')?.mid;
|
||||
|
||||
bool isPic = item.msgType == MsgType.pic.value; // 图片
|
||||
bool isText = item.msgType == MsgType.text.value; // 文本
|
||||
// bool isText = item.msgType == MsgType.text.value; // 文本
|
||||
// bool isArchive = item.msgType == 11; // 投稿
|
||||
// bool isArticle = item.msgType == 12; // 专栏
|
||||
bool isRevoke = item.msgType == MsgType.revoke.value; // 撤回消息
|
||||
bool isShareV2 = item.msgType == MsgType.share_v2.value;
|
||||
// bool isShareV2 = item.msgType == MsgType.share_v2.value;
|
||||
bool isSystem = item.msgType == MsgType.notify_text.value ||
|
||||
item.msgType == MsgType.notify_msg.value ||
|
||||
item.msgType == MsgType.pic_card.value ||
|
||||
@@ -73,17 +71,16 @@ class ChatItem extends StatelessWidget {
|
||||
|
||||
Widget richTextMessage(BuildContext context) {
|
||||
var text = content['content'];
|
||||
if (e_infos != null) {
|
||||
if (eInfos != null) {
|
||||
final List<InlineSpan> children = [];
|
||||
Map<String, String> emojiMap = {};
|
||||
for (var e in e_infos!) {
|
||||
for (var e in eInfos!) {
|
||||
emojiMap[e['text']] = e['url'];
|
||||
}
|
||||
text.splitMapJoin(
|
||||
RegExp(r"\[[^\[\]]+\]"),
|
||||
onMatch: (Match match) {
|
||||
final String emojiKey = match[0]!;
|
||||
print(emojiKey);
|
||||
if (emojiMap.containsKey(emojiKey)) {
|
||||
children.add(WidgetSpan(
|
||||
child: NetworkImgLayer(
|
||||
@@ -457,8 +454,8 @@ class ChatItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
class SystemNotice extends StatelessWidget {
|
||||
dynamic item;
|
||||
SystemNotice({super.key, this.item});
|
||||
final dynamic item;
|
||||
const SystemNotice({super.key, this.item});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -515,8 +512,8 @@ class SystemNotice extends StatelessWidget {
|
||||
}
|
||||
|
||||
class SystemNotice2 extends StatelessWidget {
|
||||
dynamic item;
|
||||
SystemNotice2({super.key, this.item});
|
||||
final dynamic item;
|
||||
const SystemNotice2({super.key, this.item});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user