Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-04 17:51:54 +08:00
parent 46ce01d76f
commit fd017e0581
8 changed files with 40 additions and 46 deletions

View File

@@ -92,7 +92,7 @@ mixin CommonDynPageMixin<T extends StatefulWidget>
child: Padding(
padding: const .fromLTRB(12, 2.5, 6, 2.5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: .spaceBetween,
children: [
Obx(
() {

View File

@@ -183,7 +183,7 @@ class _MainReplyPageState extends State<MainReplyPage>
child: Padding(
padding: const .fromLTRB(12, 2.5, 6, 2.5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: .spaceBetween,
children: [
Obx(
() {

View File

@@ -377,7 +377,7 @@ class _PgcReviewChildPageState extends State<PgcReviewChildPage>
child: Padding(
padding: const EdgeInsets.fromLTRB(12, 2.5, 6, 2.5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: .spaceBetween,
children: [
Obx(
() {

View File

@@ -123,7 +123,7 @@ class _NoteListPageState extends State<NoteListPage>
);
if (_isNested) {
child = ExtendedVisibilityDetector(
uniqueKey: const Key('note-list'),
uniqueKey: const ValueKey(NoteListPage),
child: child,
);
}

View File

@@ -262,7 +262,7 @@ class _PostPanelState extends State<PostPanel>
);
if (_isNested) {
child = ExtendedVisibilityDetector(
uniqueKey: const Key('post-panel'),
uniqueKey: const ValueKey(PostPanel),
child: child,
);
}

View File

@@ -38,6 +38,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
SingleTickerProviderStateMixin,
BaseFabMixin,
FabMixin {
late ColorScheme colorScheme;
late VideoReplyController _videoReplyController;
String get heroTag => widget.heroTag;
@@ -57,6 +58,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
@override
void didChangeDependencies() {
super.didChangeDependencies();
colorScheme = ColorScheme.of(context);
bottom = MediaQuery.viewPaddingOf(context).bottom;
}
@@ -65,7 +67,6 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
@override
Widget build(BuildContext context) {
super.build(context);
final theme = Theme.of(context);
final child = NotificationListener<UserScrollNotification>(
onNotification: (notification) {
switch (notification.direction) {
@@ -81,7 +82,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
onRefresh: _videoReplyController.onRefresh,
isClampingScrollPhysics: widget.isNested,
child: Stack(
clipBehavior: Clip.none,
clipBehavior: .none,
children: [
CustomScrollView(
controller: widget.isNested
@@ -91,45 +92,41 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
key: const PageStorageKey(_VideoReplyPanelState),
slivers: [
SliverFloatingHeaderWidget(
backgroundColor: theme.colorScheme.surface,
backgroundColor: colorScheme.surface,
child: Padding(
padding: const .fromLTRB(12, 2.5, 6, 2.5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Obx(
() => Text(
_videoReplyController.sortType.value.title,
child: Obx(() {
final sortType = _videoReplyController.sortType.value;
return Row(
mainAxisAlignment: .spaceBetween,
children: [
Text(
sortType.title,
style: const TextStyle(fontSize: 13),
),
),
TextButton.icon(
style: Style.buttonStyle,
onPressed: _videoReplyController.queryBySort,
icon: Icon(
Icons.sort,
size: 16,
color: theme.colorScheme.secondary,
),
label: Obx(
() => Text(
_videoReplyController.sortType.value.label,
TextButton.icon(
style: Style.buttonStyle,
onPressed: _videoReplyController.queryBySort,
icon: Icon(
Icons.sort,
size: 16,
color: colorScheme.secondary,
),
label: Text(
sortType.label,
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.secondary,
color: colorScheme.secondary,
),
),
),
),
],
),
],
);
}),
),
),
Obx(
() => _buildBody(
theme,
_videoReplyController.loadingState.value,
),
() => _buildBody(_videoReplyController.loadingState.value),
),
],
),
@@ -165,17 +162,14 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
);
if (widget.isNested) {
return ExtendedVisibilityDetector(
uniqueKey: const Key('reply-list'),
uniqueKey: const ValueKey(VideoReplyPanel),
child: child,
);
}
return child;
}
Widget _buildBody(
ThemeData theme,
LoadingState<List<ReplyInfo>?> loadingState,
) {
Widget _buildBody(LoadingState<List<ReplyInfo>?> loadingState) {
return switch (loadingState) {
Loading() => SliverList.builder(
itemBuilder: (context, index) => const VideoReplySkeleton(),
@@ -189,14 +183,14 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
_videoReplyController.onLoadMore();
return Container(
height: 125,
alignment: Alignment.center,
margin: EdgeInsets.only(bottom: bottom),
alignment: .center,
margin: .only(bottom: bottom),
child: Text(
_videoReplyController.isEnd ? '没有更多了' : '加载中...',
textAlign: TextAlign.center,
textAlign: .center,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
color: colorScheme.outline,
),
),
);

View File

@@ -246,9 +246,9 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
return SliverPinnedHeader(
backgroundColor: colorScheme.surface,
child: Padding(
padding: const EdgeInsets.fromLTRB(12, 2.5, 6, 2.5),
padding: const .fromLTRB(12, 2.5, 6, 2.5),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: .spaceBetween,
children: [
Obx(
() {

View File

@@ -115,7 +115,7 @@ class _ViewPointsPageState extends State<ViewPointsPage>
);
if (_isNested) {
return ExtendedVisibilityDetector(
uniqueKey: const Key('viewpoints'),
uniqueKey: const ValueKey(ViewPointsPage),
child: child,
);
}