mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: search trending page
Closes #697 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -57,6 +57,7 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final removePadding = context.width > 640;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
@@ -102,7 +103,14 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: refreshIndicator(
|
body: MediaQuery.removePadding(
|
||||||
|
context: context,
|
||||||
|
removeLeft: removePadding,
|
||||||
|
removeRight: removePadding,
|
||||||
|
child: Center(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(maxWidth: 640),
|
||||||
|
child: refreshIndicator(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
await _controller.onRefresh();
|
await _controller.onRefresh();
|
||||||
},
|
},
|
||||||
@@ -112,14 +120,25 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
|
fadeInDuration: const Duration(milliseconds: 120),
|
||||||
|
fadeOutDuration: const Duration(milliseconds: 120),
|
||||||
imageUrl:
|
imageUrl:
|
||||||
'https://activity.hdslb.com/blackboard/activity59158/img/hot_banner.fbb081df.png',
|
'https://activity.hdslb.com/blackboard/activity59158/img/hot_banner.fbb081df.png',
|
||||||
|
placeholder: (context, url) {
|
||||||
|
return AspectRatio(
|
||||||
|
aspectRatio: 1125 / 528,
|
||||||
|
child: Image.asset('assets/images/loading.png'),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Obx(() => _buildBody(_controller.loadingState.value)),
|
Obx(() => _buildBody(_controller.loadingState.value)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user