fix(recommend): 修正标题与观看全集跳转
This commit is contained in:
1 parent
23799353b5
commit
357492acb2
6 files changed
+82
-52
No files matched your search
@@ -6,15 +6,12 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../core/data/models/drama.dart';
|
||||
import '../../core/data/services/catalog_controller.dart';
|
||||
import '../../core/data/services/category_controller.dart';
|
||||
import '../../core/data/services/download_controller.dart';
|
||||
import '../../core/data/services/home_feed_controller.dart';
|
||||
import '../../core/data/services/wallet_controller.dart';
|
||||
import '../../core/navigation/fade_page_route.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/widgets/empty_state.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../player/open_player.dart';
|
||||
import '../player/player_view.dart';
|
||||
import 'recommend_types.dart';
|
||||
import 'widgets/all_dramas_filter_grid.dart';
|
||||
@@ -187,30 +184,6 @@ class _RecommendPageState extends State<RecommendPage> {
|
||||
}
|
||||
|
||||
Future<void> _openDrama(Drama drama, {String? episodeId}) async {
|
||||
final catalog = context.read<CatalogController>();
|
||||
final wallet = context.read<WalletController>();
|
||||
final downloads = context.read<DownloadController>();
|
||||
var playable = drama;
|
||||
try {
|
||||
playable = await catalog.requireDetail(drama);
|
||||
} catch (_) {
|
||||
// 卡片预览仍可直接进入播放器。
|
||||
}
|
||||
if (!mounted) return;
|
||||
final episodeIndex = episodeId == null
|
||||
? 0
|
||||
: playable.episodes.indexWhere((episode) => episode.id == episodeId);
|
||||
await Navigator.of(context).push<void>(
|
||||
FadePageRoute(
|
||||
builder: (_) => PlayerPage(
|
||||
drama: playable,
|
||||
initialIndex: episodeIndex < 0 ? 0 : episodeIndex,
|
||||
homeMode: true,
|
||||
feedDramas: [playable],
|
||||
wallet: wallet,
|
||||
downloads: downloads,
|
||||
),
|
||||
),
|
||||
);
|
||||
await playDramaFromCatalog(context, drama, episodeId: episodeId);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user