opt scrollable gesture

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-31 15:34:50 +08:00
parent 32fd0e4a76
commit 1ded09f246
52 changed files with 460 additions and 3172 deletions

View File

@@ -11,7 +11,6 @@ import 'package:PiliPlus/pages/webview/view.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/bili_utils.dart';
import 'package:PiliPlus/utils/extension/theme_ext.dart';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
@@ -94,43 +93,36 @@ class _NoteListPageState extends State<NoteListPage>
}
late Key _key;
late bool _isNested;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final controller = PrimaryScrollController.of(context);
_isNested = controller is ExtendedNestedScrollController;
_key = ValueKey(controller.hashCode);
}
@override
Widget buildList(ThemeData theme) {
Widget child = refreshIndicator(
onRefresh: _controller.onRefresh,
child: CustomScrollView(
key: _key,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
SliverPadding(
padding: const EdgeInsets.only(bottom: 100),
sliver: Obx(
() => _buildBody(theme, _controller.loadingState.value),
),
),
],
),
);
if (_isNested) {
child = ExtendedVisibilityDetector(
uniqueKey: const ValueKey(NoteListPage),
child: child,
);
}
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Expanded(child: child),
Expanded(
child: refreshIndicator(
onRefresh: _controller.onRefresh,
child: CustomScrollView(
key: _key,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
SliverPadding(
padding: const .only(bottom: 100),
sliver: Obx(
() => _buildBody(theme, _controller.loadingState.value),
),
),
],
),
),
),
Container(
padding: EdgeInsets.only(
left: 12,