opt dyn panel

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-03 13:29:16 +08:00
parent a635767561
commit 04830c7789
22 changed files with 1353 additions and 1426 deletions

View File

@@ -19,31 +19,32 @@ import 'package:get/get.dart';
// 富文本
TextSpan? richNode(
ThemeData theme,
DynamicItemModel item,
BuildContext context, {
required ThemeData theme,
required DynamicItemModel item,
required double maxWidth,
}) {
try {
late final style = TextStyle(color: theme.colorScheme.primary);
List<InlineSpan> spanChildren = [];
final moduleDynamic = item.modules.moduleDynamic;
List<RichTextNodeItem>? richTextNodes;
if (item.modules.moduleDynamic?.desc != null) {
richTextNodes = item.modules.moduleDynamic!.desc!.richTextNodes;
} else if (item.modules.moduleDynamic?.major != null) {
if (moduleDynamic?.desc case final desc?) {
richTextNodes = desc.richTextNodes;
} else if (moduleDynamic?.major?.opus case final opus?) {
// 动态页面 richTextNodes 层级可能与主页动态层级不同
richTextNodes =
item.modules.moduleDynamic!.major!.opus?.summary?.richTextNodes;
if (item.modules.moduleDynamic?.major?.opus?.title != null) {
richTextNodes = opus.summary?.richTextNodes;
if (opus.title case final title?) {
spanChildren.add(
TextSpan(
text: '${item.modules.moduleDynamic!.major!.opus!.title!}\n',
text: '$title\n',
style: const TextStyle(fontWeight: FontWeight.bold),
),
);
}
}
if (richTextNodes == null || richTextNodes.isEmpty) {
return null;
} else {