feat(app): 剧场页九宫格与极简我的页
This commit is contained in:
1 parent
dc8ca7b743
commit
35338cbfc8
46 files changed
+2353
-4358
No files matched your search
@@ -23,10 +23,10 @@ import '../../core/data/services/wallet_controller.dart';
|
||||
import '../../core/formatting/localized_content.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../discover/discover_logic.dart';
|
||||
import '../discover/discover_types.dart';
|
||||
import '../discover/discover_view.dart';
|
||||
import '../drama_detail/drama_detail_view.dart';
|
||||
import '../mine/mine_logic.dart';
|
||||
import '../mine/mine_types.dart';
|
||||
import '../mine/mine_view.dart';
|
||||
import 'player_view.dart';
|
||||
import 'widgets/drama_comments_sheet.dart';
|
||||
@@ -758,7 +758,7 @@ class PlayerLogic extends ChangeNotifier {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showMy(BuildContext context, {int initialSection = 0}) async {
|
||||
Future<void> showMy(BuildContext context) async {
|
||||
if (embedded) {
|
||||
onMy?.call();
|
||||
return;
|
||||
@@ -767,20 +767,9 @@ class PlayerLogic extends ChangeNotifier {
|
||||
await session.playbackSettled;
|
||||
await saveCurrentProgress();
|
||||
if (!context.mounted) return;
|
||||
final port = session.active;
|
||||
final drama = queue.entryAt(session.currentIndex).drama;
|
||||
final duration = port is VideoPlayerPort
|
||||
? port.controller.value.duration
|
||||
: Duration.zero;
|
||||
final action = await Navigator.of(context).push<MyPageAction>(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => MyPage(
|
||||
drama: drama,
|
||||
duration: duration,
|
||||
initialSection: initialSection,
|
||||
),
|
||||
),
|
||||
);
|
||||
final action = await Navigator.of(
|
||||
context,
|
||||
).push<MyPageAction>(MaterialPageRoute(builder: (_) => const MyPage()));
|
||||
if (!context.mounted) return;
|
||||
if (action == MyPageAction.discover) {
|
||||
await showDiscover(context);
|
||||
@@ -810,33 +799,14 @@ class PlayerLogic extends ChangeNotifier {
|
||||
await session.playbackSettled;
|
||||
await saveCurrentProgress();
|
||||
if (!context.mounted) return;
|
||||
final port = session.active;
|
||||
final duration = port is VideoPlayerPort
|
||||
? port.controller.value.duration
|
||||
: Duration.zero;
|
||||
final action = await Navigator.of(context).push<DiscoverPageAction>(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => DiscoverPage(
|
||||
drama: pageDrama,
|
||||
duration: duration,
|
||||
focusSearch: focusSearch,
|
||||
),
|
||||
),
|
||||
MaterialPageRoute(builder: (_) => DiscoverPage(focusSearch: focusSearch)),
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
if (action == DiscoverPageAction.detail) {
|
||||
await openDetail(context);
|
||||
} else if (action == DiscoverPageAction.my ||
|
||||
action == DiscoverPageAction.watchlist) {
|
||||
await showMy(
|
||||
context,
|
||||
initialSection: action == DiscoverPageAction.watchlist ? 1 : 0,
|
||||
);
|
||||
if (action == DiscoverPageAction.my) {
|
||||
await showMy(context);
|
||||
} else {
|
||||
session.setRouteVisible(true);
|
||||
if (action == DiscoverPageAction.resume) {
|
||||
session.setUserWantsPlay(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user