feat(flutter): 统一二级页头并恢复新剧暖色
This commit is contained in:
1 parent
7b2970d5c5
commit
1c6c92170d
26 files changed
+492
-427
No files matched your search
@@ -20,6 +20,7 @@ import '../../core/theme/app_theme.dart';
|
||||
import '../../core/widgets/auth_gate.dart';
|
||||
import '../../core/widgets/download_action.dart';
|
||||
import '../../core/widgets/empty_state.dart';
|
||||
import '../../core/widgets/subpage_header.dart';
|
||||
import '../../l10n/app_localizations.dart';
|
||||
import '../interaction/widgets/report_dialog.dart';
|
||||
import 'drama_detail_binding.dart';
|
||||
@@ -145,24 +146,14 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _loading(AppLocalizations l10n) => Scaffold(
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.surfaceTop,
|
||||
foregroundColor: AppColors.onSurface,
|
||||
title: Text(localizedDramaTitle(l10n, widget.drama)),
|
||||
),
|
||||
body: const Center(child: CircularProgressIndicator()),
|
||||
Widget _loading(AppLocalizations l10n) => _statePage(
|
||||
localizedDramaTitle(l10n, widget.drama),
|
||||
const Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
|
||||
Widget _failed(AppLocalizations l10n) => Scaffold(
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.surfaceTop,
|
||||
foregroundColor: AppColors.onSurface,
|
||||
title: Text(localizedDramaTitle(l10n, widget.drama)),
|
||||
),
|
||||
body: Center(
|
||||
Widget _failed(AppLocalizations l10n) => _statePage(
|
||||
localizedDramaTitle(l10n, widget.drama),
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 32),
|
||||
child: Column(
|
||||
@@ -181,14 +172,9 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
),
|
||||
);
|
||||
|
||||
Widget _empty(AppLocalizations l10n, Drama drama) => Scaffold(
|
||||
backgroundColor: AppColors.ink,
|
||||
appBar: AppBar(
|
||||
backgroundColor: AppColors.surfaceTop,
|
||||
foregroundColor: AppColors.onSurface,
|
||||
title: Text(localizedDramaTitle(l10n, drama)),
|
||||
),
|
||||
body: EmptyState(
|
||||
Widget _empty(AppLocalizations l10n, Drama drama) => _statePage(
|
||||
localizedDramaTitle(l10n, drama),
|
||||
EmptyState(
|
||||
key: const Key('drama-detail-empty'),
|
||||
icon: Icons.video_library_outlined,
|
||||
title: l10n.noEpisodesYet,
|
||||
@@ -198,6 +184,18 @@ class _DramaDetailPageState extends State<DramaDetailPage> {
|
||||
),
|
||||
);
|
||||
|
||||
Widget _statePage(String title, Widget child) => Scaffold(
|
||||
backgroundColor: AppColors.ink,
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
AppSubpageHeader(title: title, backKey: const Key('detail-back')),
|
||||
Expanded(child: child),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Widget? _resume(AppLocalizations l10n) {
|
||||
final fraction = _continueFraction;
|
||||
final progressError = logic.progressError;
|
||||
|
||||
@@ -6,6 +6,7 @@ import '../../../core/data/models/drama.dart';
|
||||
import '../../../core/formatting/localized_content.dart';
|
||||
import '../../../core/theme/app_colors.dart';
|
||||
import '../../../core/widgets/remote_image.dart';
|
||||
import '../../../core/widgets/subpage_header.dart';
|
||||
import '../../../l10n/app_localizations.dart';
|
||||
|
||||
const double _horizontal = 14;
|
||||
@@ -80,11 +81,10 @@ class DramaDetailHeader extends StatelessWidget {
|
||||
Widget _actions(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
_CircleAction(
|
||||
actionKey: const Key('detail-back'),
|
||||
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
|
||||
icon: Icons.chevron_left_rounded,
|
||||
onPressed: actions.onBack,
|
||||
AppSubpageBackButton(
|
||||
backKey: const Key('detail-back'),
|
||||
dark: true,
|
||||
onBack: actions.onBack,
|
||||
),
|
||||
const Spacer(),
|
||||
_CircleAction(
|
||||
|
||||
Reference in new issue
Block a user