Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-05-06 14:14:19 +08:00
parent 1a8c348af1
commit 07843a5e77
239 changed files with 3175 additions and 13237 deletions

View File

@@ -65,83 +65,87 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
final height = width * 528 / 1125;
_offset = height - 56 - padding.top;
listener();
return Scaffold(
extendBody: true,
extendBodyBehindAppBar: true,
resizeToAvoidBottomInset: false,
appBar: PreferredSize(
preferredSize: const Size.fromHeight(56),
child: Obx(
() {
final scrollRatio = _scrollRatio.value;
final flag = maxWidth > width || scrollRatio >= 0.5;
return AppBar(
title: Opacity(
opacity: scrollRatio,
child: Text(
'bilibili热搜',
style: TextStyle(
color: flag ? null : Colors.white,
return Material(
child: Stack(
children: [
Padding(
padding: EdgeInsets.only(
left: padding.left,
right: padding.right,
),
child: Center(
child: SizedBox(
width: width,
child: refreshIndicator(
onRefresh: _controller.onRefresh,
child: CustomScrollView(
controller: _controller.scrollController,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
SliverToBoxAdapter(
child: Image.asset(
width: width,
height: height,
cacheWidth: width.cacheSize(context),
Assets.trendingBanner,
filterQuality: FilterQuality.low,
),
),
SliverPadding(
padding: EdgeInsets.only(bottom: padding.bottom + 100),
sliver: Obx(
() =>
_buildBody(theme, _controller.loadingState.value),
),
),
],
),
),
),
backgroundColor: theme.colorScheme.surface.withValues(
alpha: scrollRatio,
),
foregroundColor: flag ? null : Colors.white,
systemOverlayStyle: flag
? null
: const SystemUiOverlayStyle(
statusBarBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.light,
),
shape: scrollRatio == 1
? Border(
bottom: BorderSide(
color: theme.colorScheme.outline.withValues(
alpha: 0.1,
),
),
)
: null,
);
},
),
),
body: Padding(
padding: EdgeInsets.only(
left: padding.left,
right: padding.right,
),
child: Center(
child: SizedBox(
width: width,
child: refreshIndicator(
onRefresh: _controller.onRefresh,
child: CustomScrollView(
controller: _controller.scrollController,
physics: const AlwaysScrollableScrollPhysics(),
slivers: [
SliverToBoxAdapter(
child: Image.asset(
width: width,
height: height,
cacheWidth: width.cacheSize(context),
Assets.trendingBanner,
filterQuality: FilterQuality.low,
),
),
SliverPadding(
padding: EdgeInsets.only(bottom: padding.bottom + 100),
sliver: Obx(
() => _buildBody(theme, _controller.loadingState.value),
),
),
],
),
),
),
),
Positioned(
left: 0,
top: 0,
right: 0,
child: Obx(
() {
final scrollRatio = _scrollRatio.value;
final flag = maxWidth > width || scrollRatio >= 0.5;
return AppBar(
title: Opacity(
opacity: scrollRatio,
child: Text(
'bilibili热搜',
style: TextStyle(
color: flag ? null : Colors.white,
),
),
),
backgroundColor: theme.colorScheme.surface.withValues(
alpha: scrollRatio,
),
foregroundColor: flag ? null : Colors.white,
systemOverlayStyle: flag
? null
: const SystemUiOverlayStyle(
statusBarBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.light,
),
shape: scrollRatio == 1
? Border(
bottom: BorderSide(
color: theme.colorScheme.outline.withValues(
alpha: 0.1,
),
),
)
: null,
);
},
),
),
],
),
);
}