opt chat item

Closes #2292

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-04 23:45:32 +08:00
parent 038285cbe6
commit 88f0ab1dea

View File

@@ -200,44 +200,45 @@ class ChatItem extends StatelessWidget {
Widget msgTypeCommonShareCard_14(dynamic content, Color textColor) { Widget msgTypeCommonShareCard_14(dynamic content, Color textColor) {
if (content['source'] == '直播') { if (content['source'] == '直播') {
return Column( return GestureDetector(
crossAxisAlignment: CrossAxisAlignment.start, behavior: .opaque,
children: [ onTap: () {
GestureDetector( dynamic roomId = content['sourceID'];
onTap: () { if (roomId is String) {
dynamic roomId = content['sourceID']; roomId = int.parse(roomId);
if (roomId is String) { }
roomId = int.parse(roomId); PageUtils.toLiveRoom(roomId);
} },
PageUtils.toLiveRoom(roomId); child: Column(
}, crossAxisAlignment: CrossAxisAlignment.start,
child: NetworkImgLayer( children: [
NetworkImgLayer(
width: 220, width: 220,
height: 123.75, height: 123.75,
src: content['cover'], src: content['cover'],
), ),
), const SizedBox(height: 6),
const SizedBox(height: 6), Text(
Text( content['title'] ?? "",
content['title'] ?? "", style: TextStyle(
style: TextStyle( letterSpacing: 0.6,
letterSpacing: 0.6, height: 1.5,
height: 1.5, color: textColor,
color: textColor, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, ),
), ),
), const SizedBox(height: 1),
const SizedBox(height: 1), Text(
Text( '${content['author']} · 直播',
'${content['author']} · 直播', style: TextStyle(
style: TextStyle( letterSpacing: 0.6,
letterSpacing: 0.6, height: 1.5,
height: 1.5, color: textColor.withValues(alpha: 0.6),
color: textColor.withValues(alpha: 0.6), fontSize: 12,
fontSize: 12, ),
), ),
), ],
], ),
); );
} else { } else {
return def(textColor); return def(textColor);
@@ -246,6 +247,7 @@ class ChatItem extends StatelessWidget {
Widget msgTypeArticleCard_12(dynamic content, Color textColor) { Widget msgTypeArticleCard_12(dynamic content, Color textColor) {
return GestureDetector( return GestureDetector(
behavior: .opaque,
onTap: () => Get.toNamed( onTap: () => Get.toNamed(
'/articlePage', '/articlePage',
parameters: { parameters: {
@@ -267,7 +269,7 @@ class ChatItem extends StatelessWidget {
], ],
), ),
const SizedBox(height: 6), const SizedBox(height: 6),
SelectableText( Text(
content['title'] ?? "", content['title'] ?? "",
style: TextStyle( style: TextStyle(
letterSpacing: 0.6, letterSpacing: 0.6,
@@ -278,8 +280,7 @@ class ChatItem extends StatelessWidget {
), ),
if (content['summary'] != null && content['summary'] != '') ...[ if (content['summary'] != null && content['summary'] != '') ...[
const SizedBox(height: 1), const SizedBox(height: 1),
SelectableText( Text(
scrollPhysics: const NeverScrollableScrollPhysics(),
content['summary'], content['summary'],
style: TextStyle( style: TextStyle(
letterSpacing: 0.6, letterSpacing: 0.6,
@@ -570,32 +571,20 @@ class ChatItem extends StatelessWidget {
'unsupported source type: ${content['source']}', 'unsupported source type: ${content['source']}',
); );
} }
return Column( return GestureDetector(
crossAxisAlignment: CrossAxisAlignment.start, onTap: onTap,
children: [ behavior: .opaque,
GestureDetector( child: Column(
onTap: onTap, crossAxisAlignment: CrossAxisAlignment.start,
child: NetworkImgLayer( children: [
NetworkImgLayer(
width: 220, width: 220,
height: 123.75, height: 123.75,
src: content['thumb'], src: content['thumb'],
), ),
), const SizedBox(height: 6),
const SizedBox(height: 6),
Text(
content['title'] ?? "",
style: TextStyle(
letterSpacing: 0.6,
height: 1.5,
color: textColor,
fontWeight: FontWeight.bold,
),
),
if (content['source'] == 6 &&
(content['headline'] as String?)?.isNotEmpty == true) ...[
const SizedBox(height: 1),
Text( Text(
content['headline'], content['title'] ?? "",
style: TextStyle( style: TextStyle(
letterSpacing: 0.6, letterSpacing: 0.6,
height: 1.5, height: 1.5,
@@ -603,20 +592,33 @@ class ChatItem extends StatelessWidget {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
), ),
], if (content['source'] == 6 &&
if (content['author'] != null) ...[ (content['headline'] as String?)?.isNotEmpty == true) ...[
const SizedBox(height: 1), const SizedBox(height: 1),
Text( Text(
'${content['author']}${type != null ? ' · $type' : ''}', content['headline'],
style: TextStyle( style: TextStyle(
letterSpacing: 0.6, letterSpacing: 0.6,
height: 1.5, height: 1.5,
color: textColor.withValues(alpha: 0.6), color: textColor,
fontSize: 12, fontWeight: FontWeight.bold,
),
), ),
), ],
if (content['author'] != null) ...[
const SizedBox(height: 1),
Text(
'${content['author']}${type != null ? ' · $type' : ''}',
style: TextStyle(
letterSpacing: 0.6,
height: 1.5,
color: textColor.withValues(alpha: 0.6),
fontSize: 12,
),
),
],
], ],
], ),
); );
} }
@@ -749,7 +751,7 @@ class ChatItem extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
SelectableText( Text(
content['title'], content['title'],
style: theme.textTheme.titleMedium!.copyWith( style: theme.textTheme.titleMedium!.copyWith(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,