mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-02 00:36:20 +08:00
@@ -10,6 +10,7 @@ import 'package:PiliPlus/common/widgets/scroll_behavior.dart'
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
import 'package:PiliPlus/common/widgets/sliver/sliver_floating_header.dart';
|
||||
import 'package:PiliPlus/common/widgets/sliver/sliver_to_box_adapter.dart';
|
||||
import 'package:PiliPlus/common/widgets/tap_region_surface.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/dynamics.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
@@ -105,15 +106,18 @@ class _DynamicDetailPageState
|
||||
);
|
||||
}
|
||||
|
||||
dynamic _scrollable;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_scrollable = null;
|
||||
refreshController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
final child = Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: _buildAppBar(),
|
||||
body: Padding(
|
||||
@@ -131,6 +135,10 @@ class _DynamicDetailPageState
|
||||
child: _buildBottom(),
|
||||
),
|
||||
);
|
||||
return SelectionTapRegionSurface(
|
||||
isScrolling: () => _scrollable?.shouldIgnorePointer ?? false,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
void _onEdit() {
|
||||
@@ -410,26 +418,33 @@ class _DynamicDetailPageState
|
||||
return child;
|
||||
}
|
||||
|
||||
Widget _buildDynPanel() {
|
||||
return SliverToBoxWithOffsetAdapter(
|
||||
offset: 55,
|
||||
onVisibilityChanged: controller.showTitle.call,
|
||||
child: Builder(
|
||||
builder: (context) {
|
||||
_scrollable = Scrollable.maybeOf(context);
|
||||
return DynamicPanel(
|
||||
item: controller.dynItem,
|
||||
isDetail: true,
|
||||
isDetailPortraitW: isPortrait,
|
||||
onSetPubSetting: controller.onSetPubSetting,
|
||||
onEdit: _onEdit,
|
||||
onSetReplySubject: controller.onSetReplySubject,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPortrait(double padding) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: padding),
|
||||
child: NestedScrollView(
|
||||
scrollBehavior: const NoOverscrollIndicator(),
|
||||
headerSliverBuilder: (context, innerBoxIsScrolled) {
|
||||
return [
|
||||
SliverToBoxWithOffsetAdapter(
|
||||
offset: 55,
|
||||
onVisibilityChanged: controller.showTitle.call,
|
||||
child: DynamicPanel(
|
||||
item: controller.dynItem,
|
||||
isDetail: true,
|
||||
isDetailPortraitW: isPortrait,
|
||||
onSetPubSetting: controller.onSetPubSetting,
|
||||
onEdit: _onEdit,
|
||||
onSetReplySubject: controller.onSetReplySubject,
|
||||
),
|
||||
),
|
||||
];
|
||||
return [_buildDynPanel()];
|
||||
},
|
||||
body: Column(
|
||||
children: [
|
||||
@@ -456,18 +471,7 @@ class _DynamicDetailPageState
|
||||
left: padding,
|
||||
bottom: this.padding.bottom + 100,
|
||||
),
|
||||
sliver: SliverToBoxWithOffsetAdapter(
|
||||
offset: 55,
|
||||
onVisibilityChanged: controller.showTitle.call,
|
||||
child: DynamicPanel(
|
||||
item: controller.dynItem,
|
||||
isDetail: true,
|
||||
isDetailPortraitW: isPortrait,
|
||||
onSetPubSetting: controller.onSetPubSetting,
|
||||
onEdit: _onEdit,
|
||||
onSetReplySubject: controller.onSetReplySubject,
|
||||
),
|
||||
),
|
||||
sliver: _buildDynPanel(),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user