mod: member video

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-12 20:59:18 +08:00
parent 9b86e24513
commit de9eb2292e
2 changed files with 29 additions and 26 deletions

View File

@@ -39,13 +39,13 @@ class MemberVideoCtr
String? firstAid; String? firstAid;
String? lastAid; String? lastAid;
String? fromViewAid; String? fromViewAid;
bool? isLocating; Rx<bool?> isLocating = Rx<bool?>(null);
bool? isLoadPrevious; bool? isLoadPrevious;
bool? hasPrev; bool? hasPrev;
@override @override
Future<void> onRefresh() async { Future<void> onRefresh() async {
if (isLocating == true) { if (isLocating.value == true) {
if (hasPrev == true) { if (hasPrev == true) {
isLoadPrevious = true; isLoadPrevious = true;
await queryData(); await queryData();
@@ -127,12 +127,12 @@ class MemberVideoCtr
next: next, next: next,
seasonId: seasonId, seasonId: seasonId,
seriesId: seriesId, seriesId: seriesId,
includeCursor: isLocating == true && page == 0 ? true : null, includeCursor: isLocating.value == true && page == 0 ? true : null,
); );
void queryBySort() { void queryBySort() {
if (type == ContributeType.video) { if (type == ContributeType.video) {
isLocating = null; isLocating.value = null;
order.value = order.value == 'pubdate' ? 'click' : 'pubdate'; order.value = order.value == 'pubdate' ? 'click' : 'pubdate';
} else { } else {
sort.value = sort.value == 'desc' ? 'asc' : 'desc'; sort.value = sort.value == 'desc' ? 'asc' : 'desc';
@@ -221,7 +221,7 @@ class MemberVideoCtr
@override @override
Future<void> onReload() { Future<void> onReload() {
isLocating = null; isLocating.value = null;
return super.onReload(); return super.onReload();
} }
} }

View File

@@ -63,7 +63,7 @@ class _MemberVideoState extends State<MemberVideo>
onRefresh: _controller.onRefresh, onRefresh: _controller.onRefresh,
child: CustomScrollView( child: CustomScrollView(
// physics: PositionRetainedScrollPhysics( // physics: PositionRetainedScrollPhysics(
// shouldRetain: _controller.isLocating == true, // shouldRetain: _controller.isLocating.value == true,
// parent: const ClampingScrollPhysics(), // parent: const ClampingScrollPhysics(),
// ), // ),
slivers: [ slivers: [
@@ -78,26 +78,29 @@ class _MemberVideoState extends State<MemberVideo>
), ),
), ),
if (widget.type == ContributeType.video && if (widget.type == ContributeType.video &&
_controller.fromViewAid?.isNotEmpty == true && _controller.fromViewAid?.isNotEmpty == true)
_controller.isLocating != true) Obx(
Positioned( () => _controller.isLocating.value != true
right: 15, ? Positioned(
bottom: 15, right: 15,
child: SafeArea( bottom: 15,
top: false, child: SafeArea(
left: false, top: false,
child: FloatingActionButton.extended( left: false,
onPressed: () { child: FloatingActionButton.extended(
_controller onPressed: () {
..isLocating = true _controller
..lastAid = _controller.fromViewAid ..isLocating.value = true
..page = 0 ..lastAid = _controller.fromViewAid
..loadingState.value = LoadingState.loading() ..page = 0
..queryData(); ..loadingState.value = LoadingState.loading()
}, ..queryData();
label: const Text('定位至上次观看'), },
), label: const Text('定位至上次观看'),
), ),
),
)
: const SizedBox.shrink(),
), ),
], ],
); );