opt msg item

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-24 19:02:12 +08:00
parent 11fbd2ebed
commit 61bc4ce5b1
3 changed files with 19 additions and 23 deletions

View File

@@ -704,28 +704,24 @@ class ChatItem extends StatelessWidget {
),
),
Divider(color: theme.colorScheme.primary.withValues(alpha: 0.05)),
SelectableText(content['text']),
if ((content['text'] as String?)?.isNotEmpty == true)
SelectableText(content['text']),
if (modules?.isNotEmpty == true) ...[
const SizedBox(height: 4),
Text.rich(
TextSpan(
children: modules!.indexed
.map(
(e) => TextSpan(
children: [
TextSpan(
text: e.$2['title'],
style: TextStyle(
color: theme.colorScheme.outline,
),
),
TextSpan(text: ' ${e.$2['detail']}'),
if (e.$1 != modules.length - 1)
const TextSpan(text: '\n'),
],
),
)
.toList(),
...modules!.map(
(e) => Row(
spacing: 10,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 80,
child: Text(
e['title'],
style: TextStyle(color: theme.colorScheme.outline),
),
),
Expanded(child: Text(e['detail'])),
],
),
),
],