feat(ui): 更新品牌启动页与选集交互
This commit is contained in:
1 parent
4778ce2c75
commit
c1cb7d1c11
87 files changed
+919
-552
No files matched your search
@@ -120,7 +120,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
data: AppTheme.dark(),
|
||||
child: widget.embedded
|
||||
? content
|
||||
: Scaffold(backgroundColor: const Color(0xFF0B0C10), body: content),
|
||||
: Scaffold(backgroundColor: AppColors.ink, body: content),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -159,7 +159,6 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
onAction: widget.onAction,
|
||||
),
|
||||
),
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 24)),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -176,9 +175,9 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.cream,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.w700,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
@@ -262,7 +261,7 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
];
|
||||
return SizedBox(
|
||||
key: const Key('home-category-chips'),
|
||||
height: 32,
|
||||
height: 36,
|
||||
child: ListView.separated(
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: choices.length,
|
||||
@@ -275,20 +274,18 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 180),
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14),
|
||||
decoration: BoxDecoration(
|
||||
color: selected
|
||||
? AppColors.bluePressed
|
||||
: const Color(0xFF1C1E24),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
color: selected ? AppColors.blue : AppColors.raised,
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
),
|
||||
child: Text(
|
||||
choice.label,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: selected ? Colors.white : AppColors.muted,
|
||||
color: selected ? AppColors.onPrimary : AppColors.cream,
|
||||
fontSize: 13,
|
||||
fontWeight: selected ? FontWeight.w600 : FontWeight.w500,
|
||||
fontWeight: selected ? FontWeight.w700 : FontWeight.w500,
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
@@ -302,8 +299,8 @@ class _DiscoverPageState extends State<DiscoverPage> {
|
||||
Widget _bottomNav(AppLocalizations l10n) => Container(
|
||||
height: 63,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF0D0D11),
|
||||
border: Border(top: BorderSide(color: Color(0xFF242329))),
|
||||
color: AppColors.bar,
|
||||
border: Border(top: BorderSide(color: AppColors.outlineVariantDark)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
@@ -363,12 +360,12 @@ class _DiscoverNavItem extends StatelessWidget {
|
||||
Icon(
|
||||
icon,
|
||||
size: 21,
|
||||
color: selected ? _accent : const Color(0xFFCAC4C7),
|
||||
color: selected ? AppColors.blueSoft : AppColors.muted,
|
||||
),
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: selected ? _accent : const Color(0xFFCAC4C7),
|
||||
color: selected ? AppColors.blueSoft : AppColors.muted,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
@@ -379,8 +376,7 @@ class _DiscoverNavItem extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
const _accent = AppColors.blueSoft;
|
||||
const _coin = Color(0xFFF5C451);
|
||||
const _coin = AppColors.gold;
|
||||
|
||||
class _BrandMark extends StatelessWidget {
|
||||
const _BrandMark();
|
||||
@@ -418,8 +414,10 @@ class _HeaderPill extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: const Color(0xFF1C1E24),
|
||||
shape: const StadiumBorder(side: BorderSide(color: Color(0x66F5C451))),
|
||||
color: AppColors.raised,
|
||||
shape: StadiumBorder(
|
||||
side: BorderSide(color: AppColors.gold.withValues(alpha: 0.45)),
|
||||
),
|
||||
child: InkWell(
|
||||
customBorder: const StadiumBorder(),
|
||||
onTap: onTap,
|
||||
@@ -434,9 +432,9 @@ class _HeaderPill extends StatelessWidget {
|
||||
label,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
color: AppColors.cream,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
fontWeight: FontWeight.w700,
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -16,28 +16,20 @@ class _HomeDramaGrid extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (categories.loading && categories.feed.sections.isEmpty) {
|
||||
return const SliverPadding(
|
||||
padding: EdgeInsets.symmetric(vertical: 24),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
||||
),
|
||||
return const SliverFillRemaining(
|
||||
hasScrollBody: false,
|
||||
child: Center(child: CircularProgressIndicator(strokeWidth: 2)),
|
||||
);
|
||||
}
|
||||
if (categories.error != null) {
|
||||
return SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 18),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
l10n.categoriesError,
|
||||
style: const TextStyle(color: AppColors.muted),
|
||||
),
|
||||
),
|
||||
TextButton(onPressed: categories.load, child: Text(l10n.retry)),
|
||||
],
|
||||
),
|
||||
return _fill(
|
||||
EmptyState(
|
||||
key: const Key('home-categories-error'),
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: l10n.categoriesError,
|
||||
subtitle: l10n.emptyHint,
|
||||
actionLabel: l10n.retry,
|
||||
onAction: categories.load,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -45,45 +37,51 @@ class _HomeDramaGrid extends StatelessWidget {
|
||||
final dramas = categories.visibleDramas;
|
||||
if (dramas.isEmpty) {
|
||||
final missingCategory = categories.selectedSectionMissing;
|
||||
return SliverPadding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 6, 16, 24),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: EmptyState(
|
||||
key: const Key('home-all-dramas-empty'),
|
||||
icon: missingCategory
|
||||
? Icons.grid_view_rounded
|
||||
: Icons.search_off_rounded,
|
||||
title: missingCategory
|
||||
? l10n.noCategoryDramas
|
||||
: l10n.noSearchResults,
|
||||
subtitle: l10n.emptyHint,
|
||||
),
|
||||
return _fill(
|
||||
EmptyState(
|
||||
key: const Key('home-all-dramas-empty'),
|
||||
icon: missingCategory
|
||||
? Icons.grid_view_rounded
|
||||
: Icons.search_off_rounded,
|
||||
title: missingCategory ? l10n.noCategoryDramas : l10n.noSearchResults,
|
||||
subtitle: l10n.emptyHint,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return SliverPadding(
|
||||
key: const Key('home-all-dramas-section'),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: SliverGrid(
|
||||
key: const Key('home-all-dramas-grid'),
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisSpacing: 14,
|
||||
crossAxisSpacing: 10,
|
||||
childAspectRatio: 2 / 3,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) => _HomeDramaCard(
|
||||
l10n: l10n,
|
||||
drama: dramas[index],
|
||||
onTap: () => onOpen(dramas[index]),
|
||||
),
|
||||
childCount: dramas.length,
|
||||
),
|
||||
),
|
||||
return SliverMainAxisGroup(
|
||||
slivers: [
|
||||
_dramaGrid(dramas),
|
||||
const SliverToBoxAdapter(child: SizedBox(height: 24)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _dramaGrid(List<Drama> dramas) => SliverPadding(
|
||||
key: const Key('home-all-dramas-section'),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
sliver: SliverGrid(
|
||||
key: const Key('home-all-dramas-grid'),
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisSpacing: 14,
|
||||
crossAxisSpacing: 10,
|
||||
childAspectRatio: 2 / 3,
|
||||
),
|
||||
delegate: SliverChildBuilderDelegate(
|
||||
(context, index) => _HomeDramaCard(
|
||||
l10n: l10n,
|
||||
drama: dramas[index],
|
||||
onTap: () => onOpen(dramas[index]),
|
||||
),
|
||||
childCount: dramas.length,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Widget _fill(Widget child) {
|
||||
return SliverFillRemaining(hasScrollBody: false, child: child);
|
||||
}
|
||||
}
|
||||
|
||||
class _HomeDramaCard extends StatelessWidget {
|
||||
@@ -122,11 +120,37 @@ class _HomeDramaCard extends StatelessWidget {
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Color(0x00000000), Color(0xE6000000)],
|
||||
stops: [0.4, 1],
|
||||
colors: [Color(0x00000000), Color(0xE6100C0A)],
|
||||
stops: [0.42, 1],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (drama.isHot)
|
||||
Positioned(
|
||||
top: 8,
|
||||
left: 8,
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.blue,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
child: Text(
|
||||
l10n.hot,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onPrimary,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1.1,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
left: 10,
|
||||
right: 10,
|
||||
@@ -141,10 +165,10 @@ class _HomeDramaCard extends StatelessWidget {
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w700,
|
||||
height: 1.2,
|
||||
color: AppColors.cream,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w800,
|
||||
height: 1.15,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
|
||||
@@ -54,9 +54,9 @@ class _DownloadsPageState extends State<DownloadsPage> {
|
||||
data: AppTheme.dark(),
|
||||
child: Scaffold(
|
||||
key: const Key('downloads-page'),
|
||||
backgroundColor: const Color(0xFF0B0C10),
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFF0B0C10),
|
||||
backgroundColor: AppColors.ink,
|
||||
foregroundColor: Colors.white,
|
||||
title: Text(l10n.downloads),
|
||||
),
|
||||
@@ -79,41 +79,17 @@ class _DownloadsBody extends StatelessWidget {
|
||||
if (downloads.loading && downloads.policy == null) {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (downloads.error != null && downloads.policy == null) {
|
||||
return Center(
|
||||
if (downloads.policy == null) {
|
||||
return EmptyState(
|
||||
key: const Key('downloads-error'),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
errorText(l10n, downloads.error, l10n.downloadsError),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Colors.white70),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
FilledButton(
|
||||
key: const Key('downloads-retry'),
|
||||
onPressed: () => unawaited(downloads.load()),
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
final policy = downloads.policy;
|
||||
if (policy == null) {
|
||||
return Center(
|
||||
key: const Key('downloads-error'),
|
||||
child: FilledButton(
|
||||
key: const Key('downloads-retry'),
|
||||
onPressed: () => unawaited(downloads.load()),
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: errorText(l10n, downloads.error, l10n.downloadsError),
|
||||
actionLabel: l10n.retry,
|
||||
actionKey: const Key('downloads-retry'),
|
||||
onAction: () => unawaited(downloads.load()),
|
||||
);
|
||||
}
|
||||
final policy = downloads.policy!;
|
||||
return RefreshIndicator(
|
||||
onRefresh: downloads.load,
|
||||
child: ListView(
|
||||
|
||||
@@ -79,13 +79,13 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
if (logic.loading) {
|
||||
return const Scaffold(
|
||||
backgroundColor: Color(0xFF111111),
|
||||
backgroundColor: AppColors.ink,
|
||||
body: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
if (logic.failed) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF111111),
|
||||
backgroundColor: AppColors.ink,
|
||||
body: Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
@@ -109,9 +109,9 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
if (drama.episodes.isEmpty) {
|
||||
// 空态:详情拿到了但一集都没有(还没上传/审核中),不能白屏
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFF111111),
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFF111111),
|
||||
backgroundColor: AppColors.ink,
|
||||
foregroundColor: Colors.white,
|
||||
title: Text(localizedDramaTitle(l10n, drama)),
|
||||
),
|
||||
@@ -126,12 +126,13 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.ink,
|
||||
body: CustomScrollView(
|
||||
slivers: [
|
||||
SliverAppBar(
|
||||
expandedHeight: 300,
|
||||
pinned: true,
|
||||
backgroundColor: const Color(0xFF111111),
|
||||
backgroundColor: AppColors.ink,
|
||||
foregroundColor: Colors.white,
|
||||
actions: [
|
||||
_reportAction(context, l10n),
|
||||
|
||||
@@ -10,6 +10,7 @@ import '../../core/data/services/auth_controller.dart';
|
||||
import '../../core/data/services/favorite_controller.dart';
|
||||
import '../../core/formatting/error_text.dart';
|
||||
import '../../core/platform/haptics.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/theme/app_theme.dart';
|
||||
import '../../core/widgets/auth_gate.dart';
|
||||
import '../../core/widgets/empty_state.dart';
|
||||
@@ -52,9 +53,9 @@ class _FavoritesPageState extends State<FavoritesPage> {
|
||||
return Theme(
|
||||
data: AppTheme.dark(),
|
||||
child: Scaffold(
|
||||
backgroundColor: const Color(0xFF0B0C10),
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFF0B0C10),
|
||||
backgroundColor: AppColors.ink,
|
||||
foregroundColor: Colors.white,
|
||||
title: Text(l10n.myFavorites),
|
||||
),
|
||||
@@ -78,27 +79,13 @@ class _FavoritesBody extends StatelessWidget {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
if (favorites.error != null && favorites.cards.isEmpty) {
|
||||
return Center(
|
||||
return EmptyState(
|
||||
key: const Key('favorites-error'),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
errorText(l10n, favorites.error, l10n.favoritesError),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Colors.white70),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
FilledButton(
|
||||
key: const Key('favorites-retry'),
|
||||
onPressed: () => unawaited(favorites.load()),
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: errorText(l10n, favorites.error, l10n.favoritesError),
|
||||
actionLabel: l10n.retry,
|
||||
actionKey: const Key('favorites-retry'),
|
||||
onAction: () => unawaited(favorites.load()),
|
||||
);
|
||||
}
|
||||
if (favorites.cards.isEmpty) {
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -9,6 +9,7 @@ import '../../core/config/locale_controller.dart';
|
||||
import '../../core/data/models/drama.dart';
|
||||
import '../../core/data/models/watch_progress.dart';
|
||||
import '../../core/data/repositories/watch_history_repository.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/widgets/server_endpoint_dialog.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
|
||||
@@ -120,7 +121,7 @@ class MineLogic extends ChangeNotifier {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
backgroundColor: const Color(0xFF1C1D22),
|
||||
backgroundColor: AppColors.ink,
|
||||
showDragHandle: true,
|
||||
isScrollControlled: true,
|
||||
builder: (sheetContext) => SafeArea(
|
||||
|
||||
@@ -158,7 +158,7 @@ class _MyPageState extends State<MyPage> {
|
||||
data: AppTheme.dark(),
|
||||
child: widget.embedded
|
||||
? content
|
||||
: Scaffold(backgroundColor: const Color(0xFF0B0C10), body: content),
|
||||
: Scaffold(backgroundColor: AppColors.ink, body: content),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ class _MyPageState extends State<MyPage> {
|
||||
const SizedBox(width: 6),
|
||||
const CircleAvatar(
|
||||
radius: 14,
|
||||
backgroundColor: Color(0xFF2C2D33),
|
||||
backgroundColor: AppColors.raised,
|
||||
child: Icon(Icons.person_rounded, color: Colors.white, size: 19),
|
||||
),
|
||||
],
|
||||
@@ -229,7 +229,7 @@ class _MyPageState extends State<MyPage> {
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
radius: 28,
|
||||
backgroundColor: Color(0xFF32343A),
|
||||
backgroundColor: AppColors.raised,
|
||||
child: Icon(Icons.person_rounded, color: Colors.white, size: 30),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
@@ -269,7 +269,7 @@ class _MyPageState extends State<MyPage> {
|
||||
children: [
|
||||
const CircleAvatar(
|
||||
radius: 28,
|
||||
backgroundColor: Color(0xFF32343A),
|
||||
backgroundColor: AppColors.raised,
|
||||
child: Icon(Icons.person_rounded, color: Colors.white, size: 30),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
@@ -297,7 +297,7 @@ class _MyPageState extends State<MyPage> {
|
||||
TextButton(
|
||||
onPressed: widget.onSignOut ?? () => _mockSnack(l10n),
|
||||
style: TextButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF2A2C33),
|
||||
backgroundColor: AppColors.raised,
|
||||
foregroundColor: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 8),
|
||||
shape: const StadiumBorder(),
|
||||
@@ -312,7 +312,7 @@ class _MyPageState extends State<MyPage> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF17191F),
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(
|
||||
@@ -330,7 +330,7 @@ class _MyPageState extends State<MyPage> {
|
||||
label: l10n.coins,
|
||||
value: '\$ 0',
|
||||
action: l10n.topUpWallet,
|
||||
color: AppColors.blue,
|
||||
color: AppColors.gold,
|
||||
onPressed: () => _mockSnack(l10n),
|
||||
),
|
||||
),
|
||||
@@ -340,7 +340,7 @@ class _MyPageState extends State<MyPage> {
|
||||
label: l10n.vipMembership,
|
||||
value: l10n.notActive,
|
||||
action: l10n.joinVip,
|
||||
color: const Color(0xFFF5C451),
|
||||
color: AppColors.blue,
|
||||
onPressed: () => _mockSnack(l10n),
|
||||
),
|
||||
),
|
||||
@@ -367,7 +367,7 @@ class _MyPageState extends State<MyPage> {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF12141A),
|
||||
color: AppColors.ink,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
border: Border.all(color: color.withValues(alpha: 0.45)),
|
||||
),
|
||||
@@ -389,7 +389,7 @@ class _MyPageState extends State<MyPage> {
|
||||
backgroundColor: color,
|
||||
foregroundColor: color == AppColors.blue
|
||||
? Colors.white
|
||||
: const Color(0xFF2A2110),
|
||||
: AppColors.onGold,
|
||||
visualDensity: VisualDensity.compact,
|
||||
shape: const StadiumBorder(),
|
||||
),
|
||||
@@ -403,7 +403,7 @@ class _MyPageState extends State<MyPage> {
|
||||
|
||||
Widget _menuCard(AppLocalizations l10n) {
|
||||
return Material(
|
||||
color: const Color(0xFF17191F),
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
@@ -420,7 +420,7 @@ class _MyPageState extends State<MyPage> {
|
||||
),
|
||||
onTap: () => _mockSnack(l10n),
|
||||
),
|
||||
const Divider(height: 1, color: Color(0xFF2A2C33)),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
key: const Key('mine-notices'),
|
||||
leading: const Icon(
|
||||
@@ -433,7 +433,7 @@ class _MyPageState extends State<MyPage> {
|
||||
MaterialPageRoute(builder: (_) => const NoticesPage()),
|
||||
),
|
||||
),
|
||||
const Divider(height: 1, color: Color(0xFF2A2C33)),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
Icons.history_rounded,
|
||||
@@ -445,7 +445,7 @@ class _MyPageState extends State<MyPage> {
|
||||
MaterialPageRoute(builder: (_) => const WatchRecordsPage()),
|
||||
),
|
||||
),
|
||||
const Divider(height: 1, color: Color(0xFF2A2C33)),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
Icons.favorite_outline_rounded,
|
||||
@@ -457,7 +457,7 @@ class _MyPageState extends State<MyPage> {
|
||||
MaterialPageRoute(builder: (_) => const FavoritesPage()),
|
||||
),
|
||||
),
|
||||
const Divider(height: 1, color: Color(0xFF2A2C33)),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
Icons.download_outlined,
|
||||
@@ -469,7 +469,7 @@ class _MyPageState extends State<MyPage> {
|
||||
MaterialPageRoute(builder: (_) => const DownloadsPage()),
|
||||
),
|
||||
),
|
||||
const Divider(height: 1, color: Color(0xFF2A2C33)),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
leading: const Icon(
|
||||
Icons.settings_rounded,
|
||||
@@ -530,8 +530,8 @@ class _MyPageState extends State<MyPage> {
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: logic.section == index
|
||||
? AppColors.bluePressed
|
||||
: const Color(0xFF24262E),
|
||||
? AppColors.blue
|
||||
: AppColors.raised,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Text(
|
||||
@@ -564,8 +564,8 @@ class _MyPageState extends State<MyPage> {
|
||||
onSelected: (_) => logic.selectFilter(index),
|
||||
showCheckmark: false,
|
||||
visualDensity: VisualDensity.compact,
|
||||
backgroundColor: const Color(0xFF242328),
|
||||
selectedColor: _accent,
|
||||
backgroundColor: AppColors.raised,
|
||||
selectedColor: AppColors.blue,
|
||||
labelStyle: TextStyle(
|
||||
color: logic.filter == index
|
||||
? Colors.white
|
||||
@@ -592,7 +592,7 @@ class _MyPageState extends State<MyPage> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(9),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF1B1C21),
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
@@ -635,7 +635,7 @@ class _MyPageState extends State<MyPage> {
|
||||
),
|
||||
const CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: Color(0xFF313137),
|
||||
backgroundColor: AppColors.raised,
|
||||
child: Icon(
|
||||
Icons.play_arrow_rounded,
|
||||
color: _accent,
|
||||
@@ -658,21 +658,12 @@ class _MyPageState extends State<MyPage> {
|
||||
),
|
||||
)
|
||||
else if (isWatchlist && favorites.error != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 18),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
errorText(l10n, favorites.error, l10n.favoritesError),
|
||||
style: const TextStyle(color: Color(0xFFE6E1E3)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => unawaited(favorites.load()),
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
EmptyState(
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: errorText(l10n, favorites.error, l10n.favoritesError),
|
||||
actionLabel: l10n.retry,
|
||||
onAction: () => unawaited(favorites.load()),
|
||||
compact: true,
|
||||
)
|
||||
else if (logic.section != 0 && markedDramas.isNotEmpty)
|
||||
for (final drama in markedDramas) ...[
|
||||
@@ -789,7 +780,7 @@ class _MyPageState extends State<MyPage> {
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(9),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFF1B1C21),
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
@@ -832,8 +823,8 @@ class _MyPageState extends State<MyPage> {
|
||||
Widget _bottomNav(AppLocalizations l10n) => Container(
|
||||
height: 63,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF0D0D11),
|
||||
border: Border(top: BorderSide(color: Color(0xFF242329))),
|
||||
color: AppColors.bar,
|
||||
border: Border(top: BorderSide(color: AppColors.outlineVariantDark)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
@@ -898,12 +889,12 @@ class _NavItem extends StatelessWidget {
|
||||
Icon(
|
||||
icon,
|
||||
size: 21,
|
||||
color: selected ? _accent : const Color(0xFFCAC4C7),
|
||||
color: selected ? _accent : AppColors.muted,
|
||||
),
|
||||
Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
color: selected ? _accent : const Color(0xFFCAC4C7),
|
||||
color: selected ? _accent : AppColors.muted,
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
|
||||
@@ -74,28 +74,17 @@ class _NoticesPageState extends State<NoticesPage> {
|
||||
children: [
|
||||
SizedBox(
|
||||
height: MediaQuery.sizeOf(context).height * 0.7,
|
||||
child: Center(
|
||||
child: EmptyState(
|
||||
key: const Key('notices-error'),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
errorText(
|
||||
l10n,
|
||||
_controller.error,
|
||||
l10n.noticesLoadFailed,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: AppColors.muted),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
FilledButton(
|
||||
key: const Key('notices-retry'),
|
||||
onPressed: _controller.load,
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: errorText(
|
||||
l10n,
|
||||
_controller.error,
|
||||
l10n.noticesLoadFailed,
|
||||
),
|
||||
actionLabel: l10n.retry,
|
||||
actionKey: const Key('notices-retry'),
|
||||
onAction: _controller.load,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -29,6 +29,9 @@ import '../mine/mine_logic.dart';
|
||||
import '../mine/mine_view.dart';
|
||||
import 'player_view.dart';
|
||||
import 'widgets/drama_comments_sheet.dart';
|
||||
import 'widgets/episode_picker_cell.dart';
|
||||
|
||||
const double _episodeCellAspect = 1.05;
|
||||
|
||||
class PlayerLogic extends ChangeNotifier {
|
||||
PlayerLogic({
|
||||
@@ -616,7 +619,7 @@ class PlayerLogic extends ChangeNotifier {
|
||||
try {
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
backgroundColor: const Color(0xFF16171C),
|
||||
backgroundColor: AppColors.ink,
|
||||
showDragHandle: true,
|
||||
builder: (sheetContext) => SafeArea(
|
||||
child: SizedBox(
|
||||
@@ -655,7 +658,7 @@ class PlayerLogic extends ChangeNotifier {
|
||||
crossAxisCount: 6,
|
||||
mainAxisSpacing: 10,
|
||||
crossAxisSpacing: 10,
|
||||
childAspectRatio: 1.45,
|
||||
childAspectRatio: _episodeCellAspect,
|
||||
),
|
||||
itemCount: episodes.length,
|
||||
itemBuilder: (_, index) => _episodeCell(
|
||||
@@ -706,38 +709,27 @@ class PlayerLogic extends ChangeNotifier {
|
||||
int currentNumber,
|
||||
) {
|
||||
final selected = episode.number == currentNumber;
|
||||
return Material(
|
||||
color: selected ? AppColors.bluePressed : const Color(0xFF2A2C33),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
onTap: () {
|
||||
Navigator.of(sheetContext).pop();
|
||||
if (homeFeed) {
|
||||
if (episode.number == currentNumber) return;
|
||||
unawaited(openSeriesAt(pageContext, drama, index));
|
||||
return;
|
||||
}
|
||||
if (index == session.currentIndex) return;
|
||||
unawaited(
|
||||
pages.animateToPage(
|
||||
index,
|
||||
duration: const Duration(milliseconds: 260),
|
||||
curve: Curves.easeOutCubic,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${episode.number}',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
final l10n = AppLocalizations.of(pageContext)!;
|
||||
return EpisodePickerCell(
|
||||
episode: episode,
|
||||
selected: selected,
|
||||
lockLabel: l10n.locked,
|
||||
onTap: () {
|
||||
Navigator.of(sheetContext).pop();
|
||||
if (homeFeed) {
|
||||
if (episode.number == currentNumber) return;
|
||||
unawaited(openSeriesAt(pageContext, drama, index));
|
||||
return;
|
||||
}
|
||||
if (index == session.currentIndex) return;
|
||||
unawaited(
|
||||
pages.animateToPage(
|
||||
index,
|
||||
duration: const Duration(milliseconds: 260),
|
||||
curve: Curves.easeOutCubic,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -843,7 +835,7 @@ class PlayerLogic extends ChangeNotifier {
|
||||
await showModalBottomSheet<void>(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
backgroundColor: const Color(0xFF232328),
|
||||
backgroundColor: AppColors.ink,
|
||||
showDragHandle: true,
|
||||
builder: (_) => DramaCommentsSheet(drama: drama),
|
||||
);
|
||||
|
||||
@@ -136,7 +136,7 @@ class _PlayerPageState extends State<PlayerPage> with WidgetsBindingObserver {
|
||||
data: AppTheme.dark(),
|
||||
child: widget.embedded
|
||||
? content
|
||||
: Scaffold(backgroundColor: Colors.black, body: content),
|
||||
: Scaffold(backgroundColor: AppColors.ink, body: content),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -183,7 +183,7 @@ class _PlayerPageState extends State<PlayerPage> with WidgetsBindingObserver {
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
const ColoredBox(color: Colors.black),
|
||||
const ColoredBox(color: AppColors.ink),
|
||||
?video,
|
||||
if (!logic.chromeHidden)
|
||||
const IgnorePointer(
|
||||
@@ -304,7 +304,7 @@ class _PlayerPageState extends State<PlayerPage> with WidgetsBindingObserver {
|
||||
child: IgnorePointer(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0x73000000),
|
||||
color: AppColors.blue,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Padding(
|
||||
@@ -494,31 +494,91 @@ class _BlockedNotice extends StatelessWidget {
|
||||
: l10n.noMediaNotice;
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 36),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28),
|
||||
child: _UnlockCard(
|
||||
locked: needsUnlock,
|
||||
title: title,
|
||||
coinLabel: needsUnlock && unlockCoin > 0
|
||||
? '$unlockCoin ${l10n.coins}'
|
||||
: null,
|
||||
footnote: needsUnlock ? l10n.unlockComingSoon : null,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Coin lock presented as a reward card: gold chip, chili only on the icon.
|
||||
class _UnlockCard extends StatelessWidget {
|
||||
const _UnlockCard({
|
||||
required this.locked,
|
||||
required this.title,
|
||||
required this.coinLabel,
|
||||
required this.footnote,
|
||||
});
|
||||
|
||||
final bool locked;
|
||||
final String title;
|
||||
final String? coinLabel;
|
||||
final String? footnote;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
border: Border.all(color: AppColors.gold.withValues(alpha: 0.55)),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 22, 20, 18),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
needsUnlock
|
||||
? Icons.lock_outline_rounded
|
||||
: Icons.movie_filter_outlined,
|
||||
color: Colors.white70,
|
||||
size: 36,
|
||||
locked ? Icons.lock_outline_rounded : Icons.movie_filter_outlined,
|
||||
color: locked ? AppColors.gold : AppColors.cream,
|
||||
size: 32,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Colors.white70),
|
||||
style: const TextStyle(
|
||||
color: AppColors.cream,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
if (needsUnlock) ...[
|
||||
const SizedBox(height: 6),
|
||||
if (coinLabel != null) ...[
|
||||
const SizedBox(height: 12),
|
||||
DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.gold,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
child: Text(
|
||||
coinLabel!,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onGold,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w800,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
if (footnote != null) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
unlockCoin > 0
|
||||
? '${l10n.unlockComingSoon} · $unlockCoin ${l10n.coins}'
|
||||
: l10n.unlockComingSoon,
|
||||
footnote!,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Colors.white38, fontSize: 12),
|
||||
style: const TextStyle(color: AppColors.muted, fontSize: 12),
|
||||
),
|
||||
],
|
||||
],
|
||||
@@ -674,14 +734,14 @@ class _PlaybackOverlay extends StatelessWidget {
|
||||
children: [
|
||||
_RailAction(
|
||||
key: const Key('rail-like'),
|
||||
icon: liked ? Icons.favorite_rounded : Icons.favorite_border_rounded,
|
||||
icon: Icons.favorite_border,
|
||||
label: l10n.like,
|
||||
selected: liked,
|
||||
onTap: onLike,
|
||||
),
|
||||
_RailAction(
|
||||
key: const Key('rail-save'),
|
||||
icon: saved ? Icons.bookmark_rounded : Icons.bookmark_border_rounded,
|
||||
icon: Icons.bookmark_border,
|
||||
label: l10n.save,
|
||||
selected: saved,
|
||||
onTap: onSave,
|
||||
@@ -693,19 +753,19 @@ class _PlaybackOverlay extends StatelessWidget {
|
||||
onTap: onDownload,
|
||||
),
|
||||
_RailAction(
|
||||
icon: Icons.grid_view_rounded,
|
||||
icon: Icons.grid_view_outlined,
|
||||
label: l10n.episodes,
|
||||
onTap: onEpisodes,
|
||||
),
|
||||
_RailAction(
|
||||
key: const Key('rail-comments'),
|
||||
icon: Icons.mode_comment_outlined,
|
||||
icon: Icons.chat_bubble_outline,
|
||||
label: l10n.comments,
|
||||
onTap: onComments,
|
||||
),
|
||||
_RailAction(
|
||||
key: const Key('rail-share'),
|
||||
icon: Icons.share_rounded,
|
||||
icon: Icons.share_outlined,
|
||||
label: l10n.share,
|
||||
onTap: onShare,
|
||||
),
|
||||
@@ -713,10 +773,16 @@ class _PlaybackOverlay extends StatelessWidget {
|
||||
IconButton(
|
||||
tooltip: l10n.pictureInPicture,
|
||||
onPressed: onPip,
|
||||
visualDensity: VisualDensity.compact,
|
||||
iconSize: 20,
|
||||
color: Colors.white,
|
||||
icon: const Icon(Icons.picture_in_picture_alt_outlined),
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: _railTapSize,
|
||||
height: _railTapSize,
|
||||
),
|
||||
color: AppColors.cream,
|
||||
icon: const Icon(
|
||||
Icons.picture_in_picture_alt_outlined,
|
||||
size: _railIconSize,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -748,6 +814,10 @@ class _PlaybackOverlay extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
const double _railIconSize = 28;
|
||||
const double _railIconWeight = 300;
|
||||
const double _railTapSize = 44;
|
||||
|
||||
class _RailAction extends StatelessWidget {
|
||||
const _RailAction({
|
||||
super.key,
|
||||
@@ -762,28 +832,16 @@ class _RailAction extends StatelessWidget {
|
||||
final bool selected;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
IconButton(
|
||||
tooltip: label,
|
||||
onPressed: onTap,
|
||||
visualDensity: VisualDensity.compact,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints.tightFor(width: 42, height: 36),
|
||||
color: selected ? AppColors.blueSoft : Colors.white,
|
||||
icon: Icon(icon, size: 24),
|
||||
),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w600,
|
||||
shadows: [Shadow(blurRadius: 8, color: Colors.black)],
|
||||
),
|
||||
),
|
||||
],
|
||||
Widget build(BuildContext context) => IconButton(
|
||||
tooltip: label,
|
||||
onPressed: onTap,
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: _railTapSize,
|
||||
height: _railTapSize,
|
||||
),
|
||||
color: selected ? AppColors.blueSoft : AppColors.cream,
|
||||
icon: Icon(icon, size: _railIconSize, weight: _railIconWeight, fill: 0),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,11 +52,11 @@ class CommentTile extends StatelessWidget {
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: isReply ? 12 : 16,
|
||||
backgroundColor: AppColors.blue.withValues(alpha: 0.2),
|
||||
backgroundColor: AppColors.raised,
|
||||
child: Icon(
|
||||
Icons.person_rounded,
|
||||
size: isReply ? 14 : 18,
|
||||
color: AppColors.blueSoft,
|
||||
color: AppColors.cream,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
@@ -101,7 +101,7 @@ class CommentTile extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
comment.content,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 14),
|
||||
style: const TextStyle(color: AppColors.cream, fontSize: 14),
|
||||
),
|
||||
if (comment.isPending)
|
||||
Padding(
|
||||
|
||||
@@ -19,9 +19,10 @@ import '../../../l10n/app_localizations.dart';
|
||||
import '../../interaction/widgets/report_dialog.dart';
|
||||
import 'comment_tile.dart';
|
||||
|
||||
const double _minSheetHeight = 240;
|
||||
const double _maxSheetHeight = 460;
|
||||
const double _minSheetHeight = 280;
|
||||
const double _maxSheetHeight = 520;
|
||||
const int _maxCommentLength = 300;
|
||||
const double _composerRadius = 22;
|
||||
|
||||
/// 服务端评论底部弹窗:匿名列表、游标翻页、回复、点赞和本人删除。
|
||||
class DramaCommentsSheet extends StatefulWidget {
|
||||
@@ -164,7 +165,7 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 8),
|
||||
padding: const EdgeInsets.fromLTRB(20, 4, 20, 12),
|
||||
child: ListenableBuilder(
|
||||
listenable: _controller,
|
||||
builder: (context, _) => _content(context),
|
||||
@@ -182,9 +183,13 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
children: [
|
||||
Text(
|
||||
l10n.comments,
|
||||
style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w700),
|
||||
style: const TextStyle(
|
||||
color: AppColors.cream,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 12),
|
||||
Expanded(child: _list(l10n)),
|
||||
if (_replyTo != null) _replyBanner(l10n, _replyTo!),
|
||||
_composer(l10n),
|
||||
@@ -199,24 +204,14 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
);
|
||||
}
|
||||
if (_controller.error != null && _controller.comments.isEmpty) {
|
||||
return Center(
|
||||
return EmptyState(
|
||||
key: const Key('comment-list-error'),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
errorText(l10n, _controller.error, l10n.commentsLoadFailed),
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: AppColors.muted),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
TextButton(
|
||||
key: const Key('comment-list-retry'),
|
||||
onPressed: _controller.load,
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: errorText(l10n, _controller.error, l10n.commentsLoadFailed),
|
||||
actionLabel: l10n.retry,
|
||||
actionKey: const Key('comment-list-retry'),
|
||||
onAction: _controller.load,
|
||||
compact: true,
|
||||
);
|
||||
}
|
||||
if (_controller.comments.isEmpty) {
|
||||
@@ -272,7 +267,7 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
l10n.replyingTo(
|
||||
replyTo.nickname.isEmpty ? l10n.anonymousUser : replyTo.nickname,
|
||||
),
|
||||
style: const TextStyle(color: AppColors.blueSoft, fontSize: 12),
|
||||
style: const TextStyle(color: AppColors.muted, fontSize: 12),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
@@ -286,6 +281,25 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
),
|
||||
);
|
||||
|
||||
InputDecoration _composerDecoration(String hint) {
|
||||
const radius = BorderRadius.all(Radius.circular(_composerRadius));
|
||||
const clear = OutlineInputBorder(
|
||||
borderRadius: radius,
|
||||
borderSide: BorderSide.none,
|
||||
);
|
||||
return InputDecoration(
|
||||
hintText: hint,
|
||||
hintStyle: const TextStyle(color: AppColors.muted, fontSize: 14),
|
||||
counterText: '',
|
||||
filled: true,
|
||||
fillColor: AppColors.raised,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
||||
border: clear,
|
||||
enabledBorder: clear,
|
||||
focusedBorder: clear,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _composer(AppLocalizations l10n) => Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -295,16 +309,9 @@ class _DramaCommentsSheetState extends State<DramaCommentsSheet> {
|
||||
focusNode: _inputFocus,
|
||||
maxLength: _maxCommentLength,
|
||||
maxLines: 1,
|
||||
decoration: InputDecoration(
|
||||
hintText: l10n.writeComment,
|
||||
counterText: '',
|
||||
filled: true,
|
||||
fillColor: const Color(0xFF35353A),
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
borderSide: BorderSide.none,
|
||||
),
|
||||
),
|
||||
style: const TextStyle(color: AppColors.cream, fontSize: 14),
|
||||
cursorColor: AppColors.gold,
|
||||
decoration: _composerDecoration(l10n.writeComment),
|
||||
onSubmitted: (_) => _post(),
|
||||
),
|
||||
),
|
||||
@@ -387,7 +394,7 @@ class _CommentThread extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/data/models/drama.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
|
||||
const double _cellRadius = 8;
|
||||
const double _numberSize = 15;
|
||||
const double _lockSize = 16;
|
||||
const double _lockGap = 4;
|
||||
const double _lockWeight = 300;
|
||||
const double _coverAlpha = 0.45;
|
||||
|
||||
/// 选集格子。需要解锁时铺一层透明底,锁在上,集数在锁下面。
|
||||
class EpisodePickerCell extends StatelessWidget {
|
||||
const EpisodePickerCell({
|
||||
required this.episode,
|
||||
required this.selected,
|
||||
required this.lockLabel,
|
||||
required this.onTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final Episode episode;
|
||||
final bool selected;
|
||||
final String lockLabel;
|
||||
final VoidCallback onTap;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
color: selected ? AppColors.bluePressed : AppColors.raised,
|
||||
borderRadius: BorderRadius.circular(_cellRadius),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
if (!episode.locked) Center(child: _EpisodeNumber(episode.number)),
|
||||
if (episode.locked)
|
||||
_LockCover(
|
||||
episodeId: episode.id,
|
||||
number: episode.number,
|
||||
label: lockLabel,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _EpisodeNumber extends StatelessWidget {
|
||||
const _EpisodeNumber(this.number);
|
||||
|
||||
final int number;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
'$number',
|
||||
style: const TextStyle(
|
||||
color: AppColors.cream,
|
||||
fontSize: _numberSize,
|
||||
fontWeight: FontWeight.w600,
|
||||
height: 1,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 透明底铺满格子,锁在上,集数在锁下面。
|
||||
class _LockCover extends StatelessWidget {
|
||||
const _LockCover({
|
||||
required this.episodeId,
|
||||
required this.number,
|
||||
required this.label,
|
||||
});
|
||||
|
||||
final String episodeId;
|
||||
final int number;
|
||||
final String label;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
ColoredBox(
|
||||
key: ValueKey('episode-lock-cover-$episodeId'),
|
||||
color: AppColors.ink.withValues(alpha: _coverAlpha),
|
||||
),
|
||||
Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.lock_outline,
|
||||
key: ValueKey('episode-lock-$episodeId'),
|
||||
size: _lockSize,
|
||||
weight: _lockWeight,
|
||||
fill: 0,
|
||||
color: AppColors.gold,
|
||||
semanticLabel: label,
|
||||
),
|
||||
const SizedBox(height: _lockGap),
|
||||
_EpisodeNumber(number),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ class _SeekProgressBarState extends State<SeekProgressBar> {
|
||||
child: SliderTheme(
|
||||
data: SliderTheme.of(context).copyWith(
|
||||
trackHeight: scrubbing ? 4 : 3,
|
||||
activeTrackColor: AppColors.blueSoft,
|
||||
activeTrackColor: AppColors.gold,
|
||||
inactiveTrackColor: Colors.white30,
|
||||
thumbColor: Colors.white,
|
||||
thumbShape: RoundSliderThumbShape(
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../core/theme/app_colors.dart';
|
||||
|
||||
const double _markSize = 84;
|
||||
const double _markRadius = 18;
|
||||
const double _loaderSize = 22;
|
||||
const double _loaderStroke = 2.5;
|
||||
const String _markAsset = 'assets/icon/splash_mark.png';
|
||||
|
||||
/// 系统开屏已经放好同一块底和图标。这一页接上加载,直到首页数据回来。
|
||||
class SplashPage extends StatelessWidget {
|
||||
const SplashPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ColoredBox(
|
||||
key: Key('splash-screen'),
|
||||
color: AppColors.ink,
|
||||
child: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Center(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(_markRadius),
|
||||
child: const Image(
|
||||
image: AssetImage(_markAsset),
|
||||
width: _markSize,
|
||||
height: _markSize,
|
||||
filterQuality: FilterQuality.medium,
|
||||
gaplessPlayback: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment(0, 0.24),
|
||||
child: SizedBox(
|
||||
width: _loaderSize,
|
||||
height: _loaderSize,
|
||||
child: CircularProgressIndicator(
|
||||
key: Key('splash-loading'),
|
||||
strokeWidth: _loaderStroke,
|
||||
color: AppColors.gold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -35,9 +35,9 @@ class WatchRecordsPage extends StatelessWidget {
|
||||
data: AppTheme.dark(),
|
||||
child: Scaffold(
|
||||
key: const Key('watch-records-page'),
|
||||
backgroundColor: const Color(0xFF0B0C10),
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: const Color(0xFF0B0C10),
|
||||
backgroundColor: AppColors.ink,
|
||||
foregroundColor: Colors.white,
|
||||
title: Text(l10n.watchHistory),
|
||||
),
|
||||
@@ -359,26 +359,12 @@ class _FailureState extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
message,
|
||||
textAlign: TextAlign.center,
|
||||
style: const TextStyle(color: Colors.white70),
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
FilledButton(
|
||||
key: const Key('watch-records-retry'),
|
||||
onPressed: () => unawaited(onRetry()),
|
||||
child: Text(l10n.retry),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
return EmptyState(
|
||||
icon: Icons.cloud_off_rounded,
|
||||
title: message,
|
||||
actionLabel: l10n.retry,
|
||||
actionKey: const Key('watch-records-retry'),
|
||||
onAction: () => unawaited(onRetry()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user