feat: 首页搜索页点击tab返回顶部

This commit is contained in:
guozhigq
2023-08-09 23:21:27 +08:00
parent 8a5a56cb15
commit d5943d88b0
8 changed files with 32 additions and 16 deletions

View File

@ -54,4 +54,15 @@ class BangumiController extends GetxController {
} else {}
return result;
}
// 返回顶部并刷新
void animateToTop() async {
if (scrollController.offset >=
MediaQuery.of(Get.context!).size.height * 5) {
scrollController.jumpTo(0);
} else {
await scrollController.animateTo(0,
duration: const Duration(milliseconds: 500), curve: Curves.easeInOut);
}
}
}