opt: main: anim to top

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-25 14:06:19 +08:00
parent a74edd22c1
commit 015309b3dc

View File

@@ -139,12 +139,6 @@ class _MainAppState extends State<MainApp>
} else {
dynamic currentPage = _mainController.pages[value];
if (currentPage is HomePage) {
_homeController.toTopOrRefresh();
} else if (currentPage is DynamicsPage) {
_dynamicController.toTopOrRefresh();
}
int now = DateTime.now().millisecondsSinceEpoch;
if (now - _lastSelectTime < 500) {
if (currentPage is HomePage) {
@@ -152,6 +146,12 @@ class _MainAppState extends State<MainApp>
} else if (currentPage is DynamicsPage) {
_dynamicController.onRefresh();
}
} else {
if (currentPage is HomePage) {
_homeController.toTopOrRefresh();
} else if (currentPage is DynamicsPage) {
_dynamicController.toTopOrRefresh();
}
}
_lastSelectTime = now;
}