mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-01 16:26:26 +08:00
opt scrollable gesture
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user