mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: tabbarSort
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -78,11 +78,7 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
||||
|
||||
void setTabConfig() async {
|
||||
defaultTabs = [...tabsConfig];
|
||||
tabbarSort = GStorage.setting
|
||||
.get(SettingBoxKey.tabbarSort,
|
||||
defaultValue: TabType.values.map((item) => item.name).toList())
|
||||
.map<String>((i) => i.toString())
|
||||
.toList();
|
||||
tabbarSort = GStorage.tabbarSort;
|
||||
defaultTabs.retainWhere(
|
||||
(item) => tabbarSort.contains((item['type'] as TabType).name));
|
||||
defaultTabs.sort((a, b) => tabbarSort
|
||||
|
||||
@@ -18,11 +18,7 @@ class _TabbarSetPageState extends State<TabbarSetPage> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
defaultTabs = tabsConfig;
|
||||
tabbarSort = GStorage.setting
|
||||
.get(SettingBoxKey.tabbarSort,
|
||||
defaultValue: ['live', 'rcmd', 'hot', 'rank', 'bangumi'])
|
||||
.map<String>((i) => i.toString())
|
||||
.toList();
|
||||
tabbarSort = GStorage.tabbarSort;
|
||||
// 对 tabData 进行排序
|
||||
defaultTabs.sort((a, b) {
|
||||
int indexA = tabbarSort.indexOf((a['type'] as TabType).name);
|
||||
|
||||
Reference in New Issue
Block a user