feat: 点击tab返回顶部

This commit is contained in:
guozhigq
2024-06-20 23:38:49 +08:00
parent 75525595c6
commit 1db1d8f598
3 changed files with 17 additions and 0 deletions

View File

@ -109,6 +109,7 @@ class VideoDetailController extends GetxController
].obs;
RxDouble sheetHeight = 0.0.obs;
RxString archiveSourceType = 'dash'.obs;
ScrollController? replyScrillController;
@override
void onInit() {
@ -551,4 +552,15 @@ class VideoDetailController extends GetxController
cover.value = videoItem['pic'] = pic;
}
}
void onControllerCreated(ScrollController controller) {
replyScrillController = controller;
}
void onTapTabbar(int index) {
if (index == 1 && tabCtr.index == 1) {
replyScrillController?.animateTo(0,
duration: const Duration(milliseconds: 300), curve: Curves.ease);
}
}
}