feat: 开屏后直接展示首页骨架

This commit is contained in:
Zhou Weidong committed 2026-10-22 23:11:03 +08:00
1 parent 56d7abc6b1
commit 5f278a3510
10 files changed
+300 -166

No files matched your search

+6 -3
View File
@@ -12,10 +12,11 @@ import '../player/open_player.dart';
import '../watch_records/watch_records_page.dart';
class HomeLogic extends ChangeNotifier {
HomeLogic(List<Drama> dramas) : currentDrama = dramas.first;
HomeLogic(List<Drama> dramas)
: currentDrama = dramas.isEmpty ? null : dramas.first;
final scaffoldKey = GlobalKey<ScaffoldState>();
Drama currentDrama;
Drama? currentDrama;
int tab = 0;
int resumeRequest = 0;
int backRequest = 0;
@@ -44,13 +45,15 @@ class HomeLogic extends ChangeNotifier {
}
Future<void> openCurrentSeries(BuildContext context) async {
final drama = currentDrama;
if (drama == null) return;
detailOpen = true;
notify();
await WidgetsBinding.instance.endOfFrame;
if (!context.mounted) return;
try {
await Navigator.of(context).push<void>(
MaterialPageRoute(builder: (_) => DramaDetailPage(drama: currentDrama)),
MaterialPageRoute(builder: (_) => DramaDetailPage(drama: drama)),
);
} finally {
if (context.mounted) {