feat(app): 完善播放协议搜索与空状态

This commit is contained in:
Zhou Weidong committed 2026-10-23 12:38:47 +08:00
1 parent 671e0ce143
commit ef29fc5f15
85 files changed
+2976 -768

No files matched your search

-2
View File
@@ -12,8 +12,6 @@ enum MineDestination {
wallet,
vip,
preferences,
works,
creatorCenter,
notices,
settings,
help,
+10 -73
View File
@@ -158,7 +158,10 @@ class _MyPageState extends State<MyPage> {
padding: const EdgeInsets.symmetric(
horizontal: AppDimens.pageHorizontal,
),
child: MineHeader(onLogin: _openLogin, onEdit: _openEditActions),
child: MineHeader(
onLogin: _openLogin,
onEdit: () => _push(const AccountProfilePage()),
),
),
Padding(
padding: const EdgeInsets.symmetric(
@@ -202,7 +205,7 @@ class _MyPageState extends State<MyPage> {
horizontal: AppDimens.mineGridHorizontal,
),
child: MineMoreServices(
onCommonQuestions: () => _pushPlaceholder(MinePlaceholderKind.help),
onCommonQuestions: _pushPlaceholder,
onAbout: () => _push(const MineAboutPage()),
),
),
@@ -222,16 +225,12 @@ class _MyPageState extends State<MyPage> {
_openVip();
case MineDestination.preferences:
_push(const FilterPage());
case MineDestination.works:
_pushPlaceholder(MinePlaceholderKind.works);
case MineDestination.creatorCenter:
_pushPlaceholder(MinePlaceholderKind.creator);
case MineDestination.notices:
_push(const NoticesPage());
case MineDestination.settings:
_push(const SettingsPage());
case MineDestination.help:
_pushPlaceholder(MinePlaceholderKind.help);
_pushPlaceholder();
}
}
@@ -248,66 +247,12 @@ class _MyPageState extends State<MyPage> {
_push(const WatchRecordsPage());
}
Future<void> _openEditActions() async {
final selected = await showModalBottomSheet<String>(
context: context,
backgroundColor: AppColors.transparent,
showDragHandle: false,
builder: (sheetContext) => Material(
color: AppColors.mineCard,
borderRadius: const BorderRadius.vertical(
top: Radius.circular(AppDimens.mineCardRadius),
),
clipBehavior: Clip.antiAlias,
child: SafeArea(
top: false,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
ListTile(
key: const Key('mine-edit-profile'),
title: Text(AppLocalizations.of(sheetContext)!.accountProfile),
onTap: () => Navigator.pop(sheetContext, 'profile'),
),
ListTile(
key: const Key('mine-edit-works'),
title: Text(AppLocalizations.of(sheetContext)!.myWorks),
onTap: () => Navigator.pop(sheetContext, 'works'),
),
ListTile(
key: const Key('mine-edit-creator'),
title: Text(AppLocalizations.of(sheetContext)!.creatorCenter),
onTap: () => Navigator.pop(sheetContext, 'creator'),
),
ListTile(
key: const Key('mine-edit-notices'),
title: Text(AppLocalizations.of(sheetContext)!.notices),
onTap: () => Navigator.pop(sheetContext, 'notices'),
),
],
),
),
),
);
if (!mounted || selected == null) return;
switch (selected) {
case 'profile':
_push(const AccountProfilePage());
case 'works':
_pushPlaceholder(MinePlaceholderKind.works);
case 'creator':
_pushPlaceholder(MinePlaceholderKind.creator);
case 'notices':
_push(const NoticesPage());
}
}
void _push(Widget page) {
Navigator.of(context).push<void>(MaterialPageRoute(builder: (_) => page));
}
void _pushPlaceholder(MinePlaceholderKind kind) {
_push(_MinePlaceholderPage(kind: kind));
void _pushPlaceholder() {
_push(const _MinePlaceholderPage());
}
Future<void> _openProtected(Widget page) async {
@@ -431,21 +376,13 @@ class _LanguageSheet extends StatelessWidget {
}
}
enum MinePlaceholderKind { works, creator, help }
class _MinePlaceholderPage extends StatelessWidget {
const _MinePlaceholderPage({required this.kind});
final MinePlaceholderKind kind;
const _MinePlaceholderPage();
@override
Widget build(BuildContext context) {
final l10n = AppLocalizations.of(context)!;
final title = switch (kind) {
MinePlaceholderKind.works => l10n.myWorks,
MinePlaceholderKind.creator => l10n.creatorCenter,
MinePlaceholderKind.help => l10n.helpFeedback,
};
final title = l10n.helpFeedback;
return PlainPageScaffold(
pageKey: const Key('mine-placeholder-page'),
backKey: const Key('mine-placeholder-back'),
+1 -1
View File
@@ -14,7 +14,7 @@ import '../../../core/widgets/remote_image.dart';
import '../../../l10n/app_localizations.dart';
const double _buttonHeight = 34;
const double _buttonRadius = 20;
const double _buttonRadius = 6;
/// 「我的」页用户区。
class MineHeader extends StatelessWidget {
+8 -1
View File
@@ -209,7 +209,14 @@ class MineMenuList extends StatelessWidget {
label: l10n.settings,
onTap: () => onOpen(MineDestination.settings),
),
_cell(index: 7),
_cell(
index: 7,
actionKey: const Key('mine-notices'),
icon: Icons.notifications_none_rounded,
iconColor: AppColors.mineIconNotices,
label: l10n.notices,
onTap: () => onOpen(MineDestination.notices),
),
],
),
],