opt: get theme color

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-28 21:32:30 +08:00
parent 451a84e696
commit ca993df0c6
149 changed files with 4415 additions and 4803 deletions

View File

@@ -98,6 +98,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
@override
Widget build(BuildContext context) {
super.build(context);
final theme = Theme.of(context);
return refreshIndicator(
onRefresh: () async {
await _videoReplyController.onRefresh();
@@ -120,7 +121,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
floating: true,
delegate: CustomSliverPersistentHeaderDelegate(
extent: 40,
bgColor: Theme.of(context).colorScheme.surface,
bgColor: theme.colorScheme.surface,
child: Container(
height: 40,
padding: const EdgeInsets.fromLTRB(12, 0, 6, 0),
@@ -141,15 +142,14 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
icon: Icon(
Icons.sort,
size: 16,
color: Theme.of(context).colorScheme.secondary,
color: theme.colorScheme.secondary,
),
label: Obx(
() => Text(
_videoReplyController.sortType.value.label,
style: TextStyle(
fontSize: 13,
color:
Theme.of(context).colorScheme.secondary,
color: theme.colorScheme.secondary,
),
),
),
@@ -160,7 +160,8 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
),
),
),
Obx(() => _buildBody(_videoReplyController.loadingState.value)),
Obx(() =>
_buildBody(theme, _videoReplyController.loadingState.value)),
],
),
Positioned(
@@ -194,7 +195,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
);
}
Widget _buildBody(LoadingState loadingState) {
Widget _buildBody(ThemeData theme, LoadingState loadingState) {
return switch (loadingState) {
Loading() => SliverList.builder(
itemBuilder: (BuildContext context, index) {
@@ -220,7 +221,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
: '没有更多了',
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.outline,
color: theme.colorScheme.outline,
),
),
);