feat(ui): 更新品牌启动页与选集交互
This commit is contained in:
1 parent
4778ce2c75
commit
c1cb7d1c11
87 files changed
+919
-552
No files matched your search
@@ -18,6 +18,7 @@ import '../../core/widgets/empty_state.dart';
|
||||
import '../../core/widgets/server_endpoint_dialog.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../discover/discover_view.dart';
|
||||
import '../splash/splash_page.dart';
|
||||
import '../mine/mine_view.dart';
|
||||
import '../player/player_view.dart';
|
||||
import 'home_binding.dart';
|
||||
@@ -30,6 +31,7 @@ class HomePage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final catalog = context.watch<CatalogController>();
|
||||
if (!catalog.settled) return const SplashPage();
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Theme(
|
||||
data: AppTheme.dark(),
|
||||
@@ -44,13 +46,13 @@ class HomePage extends StatelessWidget {
|
||||
) {
|
||||
if (catalog.loading) {
|
||||
return const Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
backgroundColor: AppColors.ink,
|
||||
body: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
if (catalog.error != null) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
backgroundColor: AppColors.ink,
|
||||
body: HomeFailureView(
|
||||
onRetry: catalog.load,
|
||||
showDebugTools: kDebugMode,
|
||||
@@ -59,7 +61,7 @@ class HomePage extends StatelessWidget {
|
||||
}
|
||||
if (catalog.dramas.isEmpty) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.black,
|
||||
backgroundColor: AppColors.ink,
|
||||
body: EmptyState(
|
||||
key: const Key('home-empty'),
|
||||
icon: Icons.movie_outlined,
|
||||
@@ -92,33 +94,37 @@ class HomeFailureView extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Center(
|
||||
return Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: EmptyState(
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: l10n.catalogError,
|
||||
actionLabel: l10n.retry,
|
||||
onAction: onRetry,
|
||||
),
|
||||
),
|
||||
if (showDebugTools) _debugTools(context, l10n),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _debugTools(BuildContext context, AppLocalizations l10n) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(24, 0, 24, 24),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.error_outline_rounded,
|
||||
color: Colors.white70,
|
||||
size: 40,
|
||||
Text(
|
||||
AppConfig.apiBaseUrl,
|
||||
style: const TextStyle(fontSize: 12, color: AppColors.muted),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OutlinedButton.icon(
|
||||
key: const Key('home-server-settings'),
|
||||
onPressed: () => showServerEndpointDialog(context, l10n),
|
||||
icon: const Icon(Icons.dns_outlined),
|
||||
label: Text(l10n.serverSettings),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(l10n.catalogError),
|
||||
const SizedBox(height: 12),
|
||||
FilledButton(onPressed: onRetry, child: Text(l10n.retry)),
|
||||
if (showDebugTools) ...[
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
AppConfig.apiBaseUrl,
|
||||
style: const TextStyle(fontSize: 12, color: Colors.white54),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
OutlinedButton.icon(
|
||||
key: const Key('home-server-settings'),
|
||||
onPressed: () => showServerEndpointDialog(context, l10n),
|
||||
icon: const Icon(Icons.dns_outlined),
|
||||
label: Text(l10n.serverSettings),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -340,7 +346,7 @@ class _TabButton extends StatelessWidget {
|
||||
vertical: 3,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: selected ? AppColors.bluePressed : null,
|
||||
color: selected ? AppColors.blue : null,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: Icon(
|
||||
|
||||
@@ -29,8 +29,8 @@ class HomeQuickDrawer extends StatelessWidget {
|
||||
final VoidCallback onWatchlist;
|
||||
final VoidCallback onLiked;
|
||||
|
||||
static const _panel = Color(0xFF222225);
|
||||
static const _card = Color(0xFF303033);
|
||||
static const _panel = AppColors.card;
|
||||
static const _card = AppColors.raised;
|
||||
static const _accent = AppColors.blueSoft;
|
||||
|
||||
@override
|
||||
@@ -129,8 +129,8 @@ class HomeQuickDrawer extends StatelessWidget {
|
||||
key: const Key('drawer-open-series'),
|
||||
onPressed: onOpenSeries,
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: _accent,
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: AppColors.blue,
|
||||
foregroundColor: AppColors.onPrimary,
|
||||
),
|
||||
icon: const Icon(Icons.play_arrow_rounded),
|
||||
label: Text(l10n.exploreSeries),
|
||||
|
||||
Reference in new issue
Block a user