fix cm tabs scroll action

This commit is contained in:
csf 2022-10-26 21:02:20 +09:00
parent 962b5d1144
commit 64d11a9dda

View File

@ -127,12 +127,12 @@ class DesktopTabController {
if (!isDesktop || index < 0) return;
state.update((val) {
val!.selected = index;
Future.delayed(Duration.zero, (() {
Future.delayed(Duration(milliseconds: 100), (() {
if (val.pageController.hasClients) {
val.pageController.jumpToPage(index);
}
val.scrollController.itemCount = val.tabs.length;
if (val.scrollController.hasClients &&
val.scrollController.canScroll &&
val.scrollController.itemCount > index) {
val.scrollController
.scrollToItem(index, center: false, animate: true);