* tweaks

* opt: semantics
This commit is contained in:
My-Responsitories
2026-06-13 02:43:37 +00:00
committed by dom
parent d159488495
commit 1b3f27aa31
23 changed files with 82 additions and 193 deletions

View File

@@ -203,17 +203,16 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
}
return _header(theme, firstFloor);
}),
_sortWidget(theme),
_sortWidget(theme.colorScheme),
],
Obx(() => _buildBody(theme, _controller.loadingState.value)),
Obx(
() => _buildBody(theme.colorScheme, _controller.loadingState.value),
),
],
),
);
if (widget.isNested) {
return ExtendedVisibilityDetector(
uniqueKey: Key(_tag),
child: child,
);
return ExtendedVisibilityDetector(uniqueKey: Key(_tag), child: child);
}
return child;
}
@@ -243,9 +242,9 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
);
}
Widget _sortWidget(ThemeData theme) {
Widget _sortWidget(ColorScheme colorScheme) {
return SliverPinnedHeader(
backgroundColor: theme.colorScheme.surface,
backgroundColor: colorScheme.surface,
child: Padding(
padding: const EdgeInsets.fromLTRB(12, 2.5, 6, 2.5),
child: Row(
@@ -265,18 +264,11 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
TextButton.icon(
style: Style.buttonStyle,
onPressed: _controller.queryBySort,
icon: Icon(
Icons.sort,
size: 16,
color: theme.colorScheme.secondary,
),
icon: Icon(Icons.sort, size: 16, color: colorScheme.secondary),
label: Obx(
() => Text(
_controller.sortType.value.text!,
style: TextStyle(
fontSize: 13,
color: theme.colorScheme.secondary,
),
style: TextStyle(fontSize: 13, color: colorScheme.secondary),
),
),
),
@@ -287,7 +279,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
}
Widget _buildBody(
ThemeData theme,
ColorScheme colorScheme,
LoadingState<List<ReplyInfo>?> loadingState,
) {
final jumpIndex = _controller.index.value;
@@ -305,15 +297,13 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
return Container(
height: 125,
alignment: Alignment.center,
margin: EdgeInsets.only(
bottom: MediaQuery.viewPaddingOf(context).bottom,
),
margin: .only(bottom: MediaQuery.viewPaddingOf(context).bottom),
child: Text(
_controller.isEnd ? '没有更多了' : '加载中...',
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
color: theme.colorScheme.outline,
color: colorScheme.outline,
),
),
);
@@ -323,13 +313,10 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel>
return ColoredBoxTransition(
color: _colorAnimation ??= _controller.animController.drive(
ColorTween(
begin: theme.colorScheme.onInverseSurface,
end: theme.colorScheme.surface,
).chain(
CurveTween(
curve: const Interval(0.8, 1.0), // 前0.8s不变, 后0.2s开始动画
),
),
begin: colorScheme.onInverseSurface,
end: colorScheme.surface,
// 前0.8s不变, 后0.2s开始动画
).chain(CurveTween(curve: const Interval(0.8, 1.0))),
),
child: child,
);