mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-19 16:46:22 +08:00
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:PiliPlus/pages/member_video/controller.dart';
|
||||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@@ -46,11 +47,14 @@ class CustomTabBarViewClampingScrollPhysics extends ClampingScrollPhysics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MemberVideoScrollPhysics extends AlwaysScrollableScrollPhysics {
|
class MemberVideoScrollPhysics extends AlwaysScrollableScrollPhysics {
|
||||||
const MemberVideoScrollPhysics({super.parent});
|
const MemberVideoScrollPhysics({super.parent, required this.controller});
|
||||||
|
|
||||||
|
final MemberVideoCtr controller;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
MemberVideoScrollPhysics applyTo(ScrollPhysics? ancestor) {
|
MemberVideoScrollPhysics applyTo(ScrollPhysics? ancestor) {
|
||||||
return MemberVideoScrollPhysics(parent: buildParent(ancestor));
|
return MemberVideoScrollPhysics(
|
||||||
|
parent: buildParent(ancestor), controller: controller);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -60,7 +64,8 @@ class MemberVideoScrollPhysics extends AlwaysScrollableScrollPhysics {
|
|||||||
required bool isScrolling,
|
required bool isScrolling,
|
||||||
required double velocity,
|
required double velocity,
|
||||||
}) {
|
}) {
|
||||||
if (newPosition.maxScrollExtent < oldPosition.maxScrollExtent) {
|
if (controller.reload) {
|
||||||
|
controller.reload = false;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return super.adjustPositionForNewDimensions(
|
return super.adjustPositionForNewDimensions(
|
||||||
|
|||||||
@@ -213,8 +213,11 @@ class MemberVideoCtr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool reload = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onReload() {
|
Future<void> onReload() {
|
||||||
|
reload = true;
|
||||||
isLocating.value = null;
|
isLocating.value = null;
|
||||||
return super.onReload();
|
return super.onReload();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class _MemberVideoState extends State<MemberVideo>
|
|||||||
refreshIndicator(
|
refreshIndicator(
|
||||||
onRefresh: _controller.onRefresh,
|
onRefresh: _controller.onRefresh,
|
||||||
child: CustomScrollView(
|
child: CustomScrollView(
|
||||||
physics: const MemberVideoScrollPhysics(),
|
physics: MemberVideoScrollPhysics(controller: _controller),
|
||||||
slivers: [
|
slivers: [
|
||||||
SliverPadding(
|
SliverPadding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
|
|||||||
Reference in New Issue
Block a user