mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: 稍后再看&收藏夹播放全部
Co-authored-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:PiliPalaX/http/loading_state.dart';
|
||||
import 'package:PiliPalaX/models/model_hot_video_item.dart';
|
||||
import 'package:PiliPalaX/pages/common/multi_select_controller.dart';
|
||||
import 'package:PiliPalaX/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -162,4 +163,22 @@ class LaterController extends MultiSelectController {
|
||||
SmartDialog.dismiss();
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
|
||||
// 稍后再看播放全部
|
||||
Future toViewPlayAll() async {
|
||||
if (loadingState.value is Success) {
|
||||
final HotVideoItemModel firstItem =
|
||||
(loadingState.value as Success).response.first;
|
||||
final String heroTag = Utils.makeHeroTag(firstItem.bvid);
|
||||
Get.toNamed(
|
||||
'/video?bvid=${firstItem.bvid}&cid=${firstItem.cid}',
|
||||
arguments: {
|
||||
'videoItem': firstItem,
|
||||
'heroTag': heroTag,
|
||||
'sourceType': 'watchLater',
|
||||
'count': (loadingState.value as Success).response.length,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,6 +95,15 @@ class _LaterPageState extends State<LaterPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: Obx(
|
||||
() => _laterController.loadingState.value is Success
|
||||
? FloatingActionButton.extended(
|
||||
onPressed: _laterController.toViewPlayAll,
|
||||
label: const Text('播放全部'),
|
||||
icon: const Icon(Icons.playlist_play),
|
||||
)
|
||||
: const SizedBox(),
|
||||
),
|
||||
body: CustomScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
controller: _laterController.scrollController,
|
||||
|
||||
Reference in New Issue
Block a user