opt dyn panel

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-07-06 19:24:57 +08:00
parent 7cdcd6df97
commit b43c07bd51

View File

@@ -47,15 +47,33 @@ Widget module(
orig.modules.moduleDynamic?.major?.type == 'MAJOR_TYPE_NONE'; orig.modules.moduleDynamic?.major?.type == 'MAJOR_TYPE_NONE';
late final isNormalAuth = late final isNormalAuth =
orig.modules.moduleAuthor!.type == 'AUTHOR_TYPE_NORMAL'; orig.modules.moduleAuthor!.type == 'AUTHOR_TYPE_NORMAL';
return orig.type == 'DYNAMIC_TYPE_NONE' if (isNoneMajor) {
? const SizedBox.shrink() if (orig.modules.moduleDynamic?.major?.none?.tips?.isNotEmpty == true) {
: InkWell( return Container(
onTap: isNoneMajor padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
? null color: theme.dividerColor.withValues(alpha: 0.08),
: () => PageUtils.pushDynDetail(orig, floor + 1), child: Row(
onLongPress: isNoneMajor children: [
? null Icon(
: () { Icons.error,
size: 18,
color: theme.colorScheme.outline,
),
const SizedBox(width: 5),
Text(
orig.modules.moduleDynamic!.major!.none!.tips!,
style: TextStyle(color: theme.colorScheme.outline),
),
],
),
);
} else {
return const SizedBox.shrink();
}
}
return InkWell(
onTap: () => PageUtils.pushDynDetail(orig, floor + 1),
onLongPress: () {
String? title, cover, bvid; String? title, cover, bvid;
late var origMajor = orig.modules.moduleDynamic?.major; late var origMajor = orig.modules.moduleDynamic?.major;
late var major = item.modules.moduleDynamic?.major; late var major = item.modules.moduleDynamic?.major;
@@ -92,26 +110,9 @@ Widget module(
); );
}, },
child: Container( child: Container(
padding: padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
const EdgeInsets.symmetric(horizontal: 15, vertical: 8),
color: theme.dividerColor.withValues(alpha: 0.08), color: theme.dividerColor.withValues(alpha: 0.08),
child: isNoneMajor child: Column(
? Row(
children: [
Icon(
Icons.error,
size: 18,
color: theme.colorScheme.outline,
),
const SizedBox(width: 5),
Text(
orig.modules.moduleDynamic?.major?.none?.tips ??
'NONE',
style: TextStyle(color: theme.colorScheme.outline),
),
],
)
: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -124,34 +125,27 @@ Widget module(
: null, : null,
child: Text( child: Text(
'${isNormalAuth ? '@' : ''}${orig.modules.moduleAuthor!.name}', '${isNormalAuth ? '@' : ''}${orig.modules.moduleAuthor!.name}',
style: TextStyle( style: TextStyle(color: theme.colorScheme.primary),
color: theme.colorScheme.primary),
), ),
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
Text( Text(
DateUtil.dateFormat( DateUtil.dateFormat(orig.modules.moduleAuthor!.pubTs),
orig.modules.moduleAuthor!.pubTs),
style: TextStyle( style: TextStyle(
color: theme.colorScheme.outline, color: theme.colorScheme.outline,
fontSize: fontSize: theme.textTheme.labelSmall!.fontSize),
theme.textTheme.labelSmall!.fontSize),
), ),
], ],
), ),
const SizedBox(height: 5), const SizedBox(height: 5),
content( content(theme, isSave, context, orig, isDetail, callback,
theme, isSave, context, orig, isDetail, callback,
floor: floor + 1), floor: floor + 1),
module( module(theme, isSave, orig, context, isDetail, callback,
theme, isSave, orig, context, isDetail, callback,
floor: floor + 1), floor: floor + 1),
if (orig.modules.moduleDynamic?.additional != null) if (orig.modules.moduleDynamic?.additional != null)
addWidget(theme, orig, context, floor: floor + 1), addWidget(theme, orig, context, floor: floor + 1),
if (orig.modules.moduleDynamic?.major?.blocked != if (orig.modules.moduleDynamic?.major?.blocked != null)
null) blockedItem(theme, orig.modules.moduleDynamic!.major!.blocked!),
blockedItem(theme,
orig.modules.moduleDynamic!.major!.blocked!),
], ],
), ),
), ),