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