mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-20 09:06:36 +08:00
opt dyn panel
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user