web archive

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-03-23 18:28:38 +08:00
parent 2220372e4f
commit b4b3764e5f
39 changed files with 1005 additions and 306 deletions

View File

@@ -111,8 +111,7 @@ class _MemberVideoState extends State<MemberVideo>
],
),
);
if (widget.type == ContributeType.video &&
_controller.fromViewAid?.isNotEmpty == true) {
if (_controller.isVideo && _controller.fromViewAid?.isNotEmpty == true) {
if (_index == null) {
_scrollController =
PrimaryScrollController.of(this.context)
@@ -174,85 +173,11 @@ class _MemberVideoState extends State<MemberVideo>
response != null && response.isNotEmpty
? SliverMainAxisGroup(
slivers: [
SliverFloatingHeaderWidget(
backgroundColor: theme.colorScheme.surface,
child: Padding(
padding: const EdgeInsets.fromLTRB(14, 2.5, 8, 2.5),
child: Row(
children: [
Obx(
() {
final count = _controller.count.value;
return Text(
count != -1 ? '$count视频' : '',
style: const TextStyle(fontSize: 13),
);
},
),
Obx(
() {
final episodicButton =
_controller.episodicButton.value;
return episodicButton.uri?.isNotEmpty == true
? Padding(
padding: EdgeInsets.only(
left: _controller.count.value != -1
? 6
: 0,
),
child: TextButton.icon(
style: Style.buttonStyle,
onPressed: _controller.toViewPlayAll,
icon: Icon(
Icons.play_circle_outline_rounded,
size: 16,
color: theme.colorScheme.secondary,
),
label: Text(
episodicButton.text ?? '播放全部',
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.secondary,
),
),
),
)
: const SizedBox.shrink();
},
),
const Spacer(),
TextButton.icon(
style: Style.buttonStyle,
onPressed: _controller.queryBySort,
icon: Icon(
Icons.sort,
size: 16,
color: theme.colorScheme.secondary,
),
label: Obx(
() => Text(
widget.type == ContributeType.video
? _controller.order.value == 'pubdate'
? '最新发布'
: '最多播放'
: _controller.sort.value == 'desc'
? '默认'
: '倒序',
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.secondary,
),
),
),
),
],
),
),
),
_buildHeader(theme),
SliverGrid.builder(
gridDelegate: gridDelegate,
itemBuilder: (context, index) {
if (widget.type != ContributeType.season &&
if (widget.type != .season &&
index == response.length - 1) {
_controller.onLoadMore();
}
@@ -272,4 +197,79 @@ class _MemberVideoState extends State<MemberVideo>
),
};
}
Widget _buildHeader(ThemeData theme) {
return SliverFloatingHeaderWidget(
backgroundColor: theme.colorScheme.surface,
child: Padding(
padding: const EdgeInsets.fromLTRB(14, 2.5, 8, 2.5),
child: Row(
children: [
?_buildCount(),
?_buildEpisodeBtn(theme),
const Spacer(),
_buildSortBtn(theme),
],
),
),
);
}
Widget? _buildCount() {
final count = _controller.count;
if (count != null) {
return Text(
'$count视频',
style: const TextStyle(fontSize: 13),
);
}
return null;
}
Widget? _buildEpisodeBtn(ThemeData theme) {
final episodicButton = _controller.episodicButton;
if (episodicButton?.uri?.isNotEmpty ?? false) {
return Padding(
padding: EdgeInsets.only(
left: _controller.count != null ? 6 : 0,
),
child: TextButton.icon(
style: Style.buttonStyle,
onPressed: _controller.toViewPlayAll,
icon: Icon(
Icons.play_circle_outline_rounded,
size: 16,
color: theme.colorScheme.secondary,
),
label: Text(
episodicButton?.text ?? '播放全部',
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.secondary,
),
),
),
);
}
return null;
}
Widget _buildSortBtn(ThemeData theme) {
return TextButton.icon(
style: Style.buttonStyle,
onPressed: _controller.queryBySort,
icon: Icon(
Icons.sort,
size: 16,
color: theme.colorScheme.secondary,
),
label: Text(
_controller.isVideo ? _controller.order.label : _controller.sort.label,
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.secondary,
),
),
);
}
}