mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-25 18:48:43 +00:00
@@ -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,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user