refa: reply2reply panel

tweaks

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-13 14:26:08 +08:00
parent 0f2908dbc1
commit d3f4ba4b4a
16 changed files with 387 additions and 376 deletions

View File

@@ -97,100 +97,98 @@ class _IntroDetailState extends CommonCollapseSlidePageState<PgcIntroPanel> {
final TextStyle textStyle = TextStyle(
color: theme.colorScheme.onSurfaceVariant,
);
return SelectionArea(
child: ListView(
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(
left: 14,
right: 14,
top: 14,
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
),
children: [
Text(
widget.item.title!,
style: const TextStyle(fontSize: 16),
),
const SizedBox(height: 4),
Row(
spacing: 6,
children: [
StatWidget(
type: StatType.play,
value: widget.item.stat!.view,
),
StatWidget(
type: StatType.danmaku,
value: widget.item.stat!.danmaku,
),
],
),
const SizedBox(height: 4),
Row(
children: [
Text(
widget.item.areas!.first.name!,
style: smallTitle,
),
const SizedBox(width: 6),
Text(
widget.item.publish!.pubTimeShow!,
style: smallTitle,
),
const SizedBox(width: 6),
Text(
widget.item.newEp!.desc!,
style: smallTitle,
),
],
),
if (widget.item.evaluate?.isNotEmpty == true) ...[
const SizedBox(height: 20),
Text(
'简介:',
style: theme.textTheme.titleMedium,
),
const SizedBox(height: 4),
Text(
widget.item.evaluate!,
style: textStyle,
),
],
if (widget.item.actors?.isNotEmpty == true) ...[
const SizedBox(height: 20),
Text(
'演职人员:',
style: theme.textTheme.titleMedium,
),
const SizedBox(height: 4),
Text(
widget.item.actors!,
style: textStyle,
),
],
if (widget.videoTags?.isNotEmpty == true) ...[
const SizedBox(height: 10),
Wrap(
spacing: 8,
runSpacing: 8,
children: widget.videoTags!
.map(
(item) => SearchText(
fontSize: 13,
text: item.tagName!,
onTap: (tagName) => Get.toNamed(
'/searchResult',
parameters: {'keyword': tagName},
),
onLongPress: Utils.copyText,
),
)
.toList(),
),
],
],
return ListView(
controller: _controller,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(
left: 14,
right: 14,
top: 14,
bottom: MediaQuery.viewPaddingOf(context).bottom + 100,
),
children: [
SelectableText(
widget.item.title!,
style: const TextStyle(fontSize: 16),
),
const SizedBox(height: 4),
Row(
spacing: 6,
children: [
StatWidget(
type: StatType.play,
value: widget.item.stat!.view,
),
StatWidget(
type: StatType.danmaku,
value: widget.item.stat!.danmaku,
),
],
),
const SizedBox(height: 4),
Row(
children: [
Text(
widget.item.areas!.first.name!,
style: smallTitle,
),
const SizedBox(width: 6),
Text(
widget.item.publish!.pubTimeShow!,
style: smallTitle,
),
const SizedBox(width: 6),
Text(
widget.item.newEp!.desc!,
style: smallTitle,
),
],
),
if (widget.item.evaluate?.isNotEmpty == true) ...[
const SizedBox(height: 20),
Text(
'简介:',
style: theme.textTheme.titleMedium,
),
const SizedBox(height: 4),
SelectableText(
widget.item.evaluate!,
style: textStyle,
),
],
if (widget.item.actors?.isNotEmpty == true) ...[
const SizedBox(height: 20),
Text(
'演职人员:',
style: theme.textTheme.titleMedium,
),
const SizedBox(height: 4),
Text(
widget.item.actors!,
style: textStyle,
),
],
if (widget.videoTags?.isNotEmpty == true) ...[
const SizedBox(height: 10),
Wrap(
spacing: 8,
runSpacing: 8,
children: widget.videoTags!
.map(
(item) => SearchText(
fontSize: 13,
text: item.tagName!,
onTap: (tagName) => Get.toNamed(
'/searchResult',
parameters: {'keyword': tagName},
),
onLongPress: Utils.copyText,
),
)
.toList(),
),
],
],
);
}
}

View File

@@ -431,7 +431,11 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
SmartDialog.showToast('账号未登录');
return;
}
int? mid = videoDetail.value.owner?.mid;
final videoDetail = this.videoDetail.value;
if (videoDetail.staff?.isNotEmpty == true) {
return;
}
int? mid = videoDetail.owner?.mid;
if (mid == null) {
return;
}

View File

@@ -171,27 +171,13 @@ class _UgcIntroPanelState extends TripleState<UgcIntroPanel>
const SizedBox(height: 8),
if (isLoading)
_buildVideoTitle(theme, videoDetail)
else if (isHorizontal && Utils.isDesktop)
_buildTitle(theme, videoDetail, isExpand: true)
else
ExpandablePanel(
controller: introController.expandableCtr,
collapsed: GestureDetector(
onLongPress: () {
Feedback.forLongPress(context);
Utils.copyText(videoDetail.title ?? '');
},
child: _buildVideoTitle(theme, videoDetail),
),
expanded: GestureDetector(
onLongPress: () {
Feedback.forLongPress(context);
Utils.copyText(videoDetail.title ?? '');
},
child: _buildVideoTitle(
theme,
videoDetail,
isExpand: true,
),
),
collapsed: _buildTitle(theme, videoDetail),
expanded: _buildTitle(theme, videoDetail, isExpand: true),
theme: expandTheme,
),
const SizedBox(height: 8),
@@ -228,48 +214,19 @@ class _UgcIntroPanelState extends TripleState<UgcIntroPanel>
),
),
],
ExpandablePanel(
controller: introController.expandableCtr,
collapsed: const SizedBox.shrink(),
expanded: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 8),
GestureDetector(
onTap: () => Utils.copyText('${videoDetail.bvid}'),
child: Text(
videoDetail.bvid ?? '',
style: TextStyle(
fontSize: 14,
color: theme.colorScheme.secondary,
),
),
),
if (videoDetail.descV2?.isNotEmpty == true) ...[
const SizedBox(height: 8),
SelectableText.rich(
style: const TextStyle(
height: 1.4,
),
TextSpan(
children: [
buildContent(theme, videoDetail),
],
),
),
],
Obx(() {
final videoTags = introController.videoTags.value;
if (videoTags.isNullOrEmpty) {
return const SizedBox.shrink();
}
return _buildTags(videoTags!);
}),
],
if (isHorizontal && Utils.isDesktop)
..._infos(theme, videoDetail)
else
ExpandablePanel(
controller: introController.expandableCtr,
collapsed: const SizedBox.shrink(),
expanded: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: _infos(theme, videoDetail),
),
theme: expandTheme,
),
theme: expandTheme,
),
Obx(
() => introController.status.value
? const SizedBox.shrink()
@@ -339,6 +296,54 @@ class _UgcIntroPanelState extends TripleState<UgcIntroPanel>
);
}
Widget _buildTitle(
ThemeData theme,
VideoDetailData videoDetail, {
bool isExpand = false,
}) => GestureDetector(
onLongPress: () {
Feedback.forLongPress(context);
Utils.copyText(videoDetail.title ?? '');
},
child: _buildVideoTitle(
theme,
videoDetail,
isExpand: isExpand,
),
);
List<Widget> _infos(ThemeData theme, VideoDetailData videoDetail) => [
const SizedBox(height: 8),
GestureDetector(
onTap: () => Utils.copyText('${videoDetail.bvid}'),
child: Text(
videoDetail.bvid ?? '',
style: TextStyle(
fontSize: 14,
color: theme.colorScheme.secondary,
),
),
),
if (videoDetail.descV2?.isNotEmpty == true) ...[
const SizedBox(height: 8),
SelectableText.rich(
style: const TextStyle(height: 1.4),
TextSpan(
children: [
buildContent(theme, videoDetail),
],
),
),
],
Obx(() {
final videoTags = introController.videoTags.value;
if (videoTags.isNullOrEmpty) {
return const SizedBox.shrink();
}
return _buildTags(videoTags!);
}),
];
WidgetSpan _labelWidget(String text, Color bgColor, Color textColor) {
return WidgetSpan(
alignment: PlaceholderAlignment.middle,