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;
|
RxInt tabIndex = 0.obs;
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
|
|
||||||
ZoneController get controller => Get.find<ZoneController>(
|
ZoneController get controller {
|
||||||
tag: tabsConfig[tabController.index]['rid'].toString());
|
final item = tabsConfig[tabController.index];
|
||||||
|
return Get.find<ZoneController>(
|
||||||
|
tag: '${item['rid']}${item['season_type']}');
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ScrollController get scrollController => controller.scrollController;
|
ScrollController get scrollController => controller.scrollController;
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,12 @@ class _RankPageState extends State<RankPage>
|
|||||||
() => IntrinsicHeight(
|
() => IntrinsicHeight(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_rankController.tabIndex.value = index;
|
if (_rankController.tabIndex.value != index) {
|
||||||
_rankController.tabController.animateTo(index);
|
_rankController.tabIndex.value = index;
|
||||||
|
_rankController.tabController.animateTo(index);
|
||||||
|
} else {
|
||||||
|
_rankController.animateToTop();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: ColoredBox(
|
child: ColoredBox(
|
||||||
color: index == _rankController.tabIndex.value
|
color: index == _rankController.tabIndex.value
|
||||||
|
|||||||
Reference in New Issue
Block a user