mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: show video fav menu
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -34,20 +34,21 @@ class FavPage extends StatefulWidget {
|
|||||||
class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
||||||
late final TabController _tabController;
|
late final TabController _tabController;
|
||||||
final FavController _favController = Get.put(FavController());
|
final FavController _favController = Get.put(FavController());
|
||||||
late final RxInt _tabIndex;
|
late final RxBool _showVideoFavMenu;
|
||||||
|
|
||||||
void listener() {
|
void listener() {
|
||||||
_tabIndex.value = _tabController.index;
|
_showVideoFavMenu.value = _tabController.index == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
_tabIndex = (Get.arguments is int ? Get.arguments as int : 0).obs;
|
int initialIndex = Get.arguments is int ? Get.arguments as int : 0;
|
||||||
|
_showVideoFavMenu = (initialIndex == 0).obs;
|
||||||
_tabController = TabController(
|
_tabController = TabController(
|
||||||
length: _FavType.values.length,
|
length: _FavType.values.length,
|
||||||
vsync: this,
|
vsync: this,
|
||||||
initialIndex: _tabIndex.value,
|
initialIndex: initialIndex,
|
||||||
);
|
);
|
||||||
_tabController.addListener(listener);
|
_tabController.addListener(listener);
|
||||||
}
|
}
|
||||||
@@ -66,7 +67,7 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
|||||||
title: const Text('我的收藏'),
|
title: const Text('我的收藏'),
|
||||||
actions: [
|
actions: [
|
||||||
Obx(
|
Obx(
|
||||||
() => _tabIndex.value == 0
|
() => _showVideoFavMenu.value
|
||||||
? IconButton(
|
? IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.toNamed('/createFav')?.then(
|
Get.toNamed('/createFav')?.then(
|
||||||
@@ -89,7 +90,7 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
|||||||
: const SizedBox.shrink(),
|
: const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
Obx(
|
Obx(
|
||||||
() => _tabIndex.value == 0
|
() => _showVideoFavMenu.value
|
||||||
? IconButton(
|
? IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.to(FavFolderSortPage(favController: _favController));
|
Get.to(FavFolderSortPage(favController: _favController));
|
||||||
@@ -100,7 +101,7 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
|
|||||||
: const SizedBox.shrink(),
|
: const SizedBox.shrink(),
|
||||||
),
|
),
|
||||||
Obx(
|
Obx(
|
||||||
() => _tabIndex.value == 0
|
() => _showVideoFavMenu.value
|
||||||
? IconButton(
|
? IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_favController.loadingState.value is Success) {
|
if (_favController.loadingState.value is Success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user