mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
opt rank type
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -12,9 +12,8 @@ class RankController extends GetxController
|
||||
late TabController tabController;
|
||||
|
||||
ZoneController get controller {
|
||||
final item = rankTabsConfig[tabController.index];
|
||||
return Get.find<ZoneController>(
|
||||
tag: '${item['rid']}${item['season_type']}');
|
||||
final item = RankType.values[tabController.index];
|
||||
return Get.find<ZoneController>(tag: '${item.rid}${item.seasonType}');
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -23,7 +22,7 @@ class RankController extends GetxController
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
tabController = TabController(length: rankTabsConfig.length, vsync: this);
|
||||
tabController = TabController(length: RankType.values.length, vsync: this);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -32,7 +32,7 @@ class _RankPageState extends State<RankPage>
|
||||
),
|
||||
child: Column(
|
||||
children: List.generate(
|
||||
rankTabsConfig.length,
|
||||
RankType.values.length,
|
||||
(index) => Obx(
|
||||
() => IntrinsicHeight(
|
||||
child: InkWell(
|
||||
@@ -65,7 +65,7 @@ class _RankPageState extends State<RankPage>
|
||||
padding:
|
||||
const EdgeInsets.symmetric(vertical: 7),
|
||||
child: Text(
|
||||
rankTabsConfig[index]['label'],
|
||||
RankType.values[index].label,
|
||||
style: TextStyle(
|
||||
color:
|
||||
index == _rankController.tabIndex.value
|
||||
@@ -92,10 +92,10 @@ class _RankPageState extends State<RankPage>
|
||||
child: TabBarView(
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
controller: _rankController.tabController,
|
||||
children: rankTabsConfig
|
||||
children: RankType.values
|
||||
.map((item) => ZonePage(
|
||||
rid: item['rid'],
|
||||
seasonType: item['season_type'],
|
||||
rid: item.rid,
|
||||
seasonType: item.seasonType,
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user