mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: rank page
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:PiliPalaX/pages/rank/zone/index.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
@@ -9,7 +10,6 @@ class RankController extends GetxController with GetTickerProviderStateMixin {
|
||||
late RxList tabs = [].obs;
|
||||
RxInt initialIndex = 0.obs;
|
||||
late TabController tabController;
|
||||
late List tabsCtrList;
|
||||
late List<Widget> tabsPageList;
|
||||
Box setting = GStorage.setting;
|
||||
// late final StreamController<bool> searchBarStream =
|
||||
@@ -27,21 +27,20 @@ class RankController extends GetxController with GetTickerProviderStateMixin {
|
||||
|
||||
void onRefresh() {
|
||||
int index = tabController.index;
|
||||
var ctr = tabsCtrList[index];
|
||||
ctr.onRefresh();
|
||||
Get.find<ZoneController>(tag: tabsConfig[index]['rid'].toString())
|
||||
.onRefresh();
|
||||
}
|
||||
|
||||
void animateToTop() {
|
||||
int index = tabController.index;
|
||||
var ctr = tabsCtrList[index];
|
||||
ctr.animateToTop();
|
||||
Get.find<ZoneController>(tag: tabsConfig[index]['rid'].toString())
|
||||
.animateToTop();
|
||||
}
|
||||
|
||||
void setTabConfig() async {
|
||||
tabs.value = tabsConfig;
|
||||
initialIndex.value = 0;
|
||||
tabsCtrList = tabs.map((e) => e['ctr']).toList();
|
||||
tabsPageList = tabs.map<Widget>((e) => e['page']).toList();
|
||||
tabsPageList = tabs.map((item) => ZonePage(rid: item['rid'])).toList();
|
||||
|
||||
tabController = TabController(
|
||||
initialIndex: initialIndex.value,
|
||||
|
||||
Reference in New Issue
Block a user