mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: rank: anim to top
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -11,8 +11,12 @@ class RankController extends GetxController
|
||||
RxInt tabIndex = 0.obs;
|
||||
late TabController tabController;
|
||||
|
||||
ZoneController get controller => Get.find<ZoneController>(
|
||||
tag: tabsConfig[tabController.index]['rid'].toString());
|
||||
ZoneController get controller {
|
||||
final item = tabsConfig[tabController.index];
|
||||
return Get.find<ZoneController>(
|
||||
tag: '${item['rid']}${item['season_type']}');
|
||||
}
|
||||
|
||||
@override
|
||||
ScrollController get scrollController => controller.scrollController;
|
||||
|
||||
|
||||
@@ -36,8 +36,12 @@ class _RankPageState extends State<RankPage>
|
||||
() => IntrinsicHeight(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
_rankController.tabIndex.value = index;
|
||||
_rankController.tabController.animateTo(index);
|
||||
if (_rankController.tabIndex.value != index) {
|
||||
_rankController.tabIndex.value = index;
|
||||
_rankController.tabController.animateTo(index);
|
||||
} else {
|
||||
_rankController.animateToTop();
|
||||
}
|
||||
},
|
||||
child: ColoredBox(
|
||||
color: index == _rankController.tabIndex.value
|
||||
|
||||
Reference in New Issue
Block a user