mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: trending page
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -34,13 +34,6 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
_controller.scrollController.addListener(listener);
|
_controller.scrollController.addListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
|
||||||
void didChangeDependencies() {
|
|
||||||
super.didChangeDependencies();
|
|
||||||
_offset = Get.width * 528 / 1125 - 56 - Get.mediaQuery.padding.top;
|
|
||||||
listener();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
_controller.scrollController.removeListener(listener);
|
_controller.scrollController.removeListener(listener);
|
||||||
@@ -60,10 +53,12 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return LayoutBuilder(builder: (context, constraints) {
|
return LayoutBuilder(builder: (context, constraints) {
|
||||||
final width = constraints.maxWidth;
|
final maxWidth = constraints.maxWidth;
|
||||||
final maxWidth = constraints.maxWidth > constraints.maxHeight
|
final width = constraints.maxWidth > constraints.maxHeight
|
||||||
? min(640.0, width * 0.6)
|
? min(640.0, maxWidth * 0.6)
|
||||||
: width;
|
: maxWidth;
|
||||||
|
_offset = width * 528 / 1125 - 56 - Get.mediaQuery.padding.top;
|
||||||
|
listener();
|
||||||
final removePadding = width > maxWidth;
|
final removePadding = width > maxWidth;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
@@ -111,8 +106,8 @@ class _SearchTrendingPageState extends State<SearchTrendingPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
body: Center(
|
body: Center(
|
||||||
child: ConstrainedBox(
|
child: SizedBox(
|
||||||
constraints: BoxConstraints(maxWidth: maxWidth),
|
width: width,
|
||||||
child: MediaQuery.removePadding(
|
child: MediaQuery.removePadding(
|
||||||
context: context,
|
context: context,
|
||||||
removeLeft: removePadding,
|
removeLeft: removePadding,
|
||||||
|
|||||||
Reference in New Issue
Block a user