mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 20:12:35 +08:00
@@ -11,6 +11,7 @@ import 'package:PiliPlus/pages/home/controller.dart';
|
||||
import 'package:PiliPlus/pages/hot/controller.dart';
|
||||
import 'package:PiliPlus/pages/rank/view.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -67,65 +68,59 @@ class _HotPageState extends CommonPageState<HotPage, HotController>
|
||||
controller: controller.scrollController,
|
||||
slivers: [
|
||||
SliverToBoxAdapter(
|
||||
child: Obx(
|
||||
() => controller.showHotRcmd.value
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 12,
|
||||
top: 12,
|
||||
right: 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
_buildEntranceItem(
|
||||
iconUrl:
|
||||
'http://i0.hdslb.com/bfs/archive/a3f11218aaf4521b4967db2ae164ecd3052586b9.png',
|
||||
title: '排行榜',
|
||||
onTap: () {
|
||||
try {
|
||||
HomeController homeController =
|
||||
Get.find<HomeController>();
|
||||
int index = homeController.tabs.indexOf(
|
||||
HomeTabType.rank,
|
||||
child: Pref.showHotRcmd
|
||||
? Padding(
|
||||
padding: const .only(left: 12, top: 12, right: 12),
|
||||
child: Row(
|
||||
mainAxisAlignment: .spaceEvenly,
|
||||
children: [
|
||||
_buildEntranceItem(
|
||||
iconUrl:
|
||||
'https://i0.hdslb.com/bfs/archive/a3f11218aaf4521b4967db2ae164ecd3052586b9.png',
|
||||
title: '排行榜',
|
||||
onTap: () {
|
||||
try {
|
||||
HomeController homeController =
|
||||
Get.find<HomeController>();
|
||||
int index = homeController.tabs.indexOf(
|
||||
HomeTabType.rank,
|
||||
);
|
||||
if (index != -1) {
|
||||
homeController.tabController.animateTo(
|
||||
index,
|
||||
);
|
||||
if (index != -1) {
|
||||
homeController.tabController.animateTo(
|
||||
index,
|
||||
);
|
||||
} else {
|
||||
Get.to(
|
||||
Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: const Text('排行榜'),
|
||||
),
|
||||
body: const ViewSafeArea(
|
||||
child: RankPage(),
|
||||
),
|
||||
} else {
|
||||
Get.to(
|
||||
Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
appBar: AppBar(
|
||||
title: const Text('排行榜'),
|
||||
),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
},
|
||||
),
|
||||
_buildEntranceItem(
|
||||
iconUrl:
|
||||
'https://i0.hdslb.com/bfs/archive/552ebe8c4794aeef30ebd1568b59ad35f15e21ad.png',
|
||||
title: '每周必看',
|
||||
onTap: () => Get.toNamed('/popularSeries'),
|
||||
),
|
||||
_buildEntranceItem(
|
||||
iconUrl:
|
||||
'https://i0.hdslb.com/bfs/archive/3693ec9335b78ca57353ac0734f36a46f3d179a9.png',
|
||||
title: '入站必刷',
|
||||
onTap: () => Get.toNamed('/popularPrecious'),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
body: const ViewSafeArea(
|
||||
child: RankPage(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
},
|
||||
),
|
||||
_buildEntranceItem(
|
||||
iconUrl:
|
||||
'https://i0.hdslb.com/bfs/archive/552ebe8c4794aeef30ebd1568b59ad35f15e21ad.png',
|
||||
title: '每周必看',
|
||||
onTap: () => Get.toNamed('/popularSeries'),
|
||||
),
|
||||
_buildEntranceItem(
|
||||
iconUrl:
|
||||
'https://i0.hdslb.com/bfs/archive/3693ec9335b78ca57353ac0734f36a46f3d179a9.png',
|
||||
title: '入站必刷',
|
||||
onTap: () => Get.toNamed('/popularPrecious'),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
),
|
||||
SliverPadding(
|
||||
padding: const EdgeInsets.only(top: 7, bottom: 100),
|
||||
|
||||
Reference in New Issue
Block a user