feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -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'),
|
||||
|
||||
Reference in new issue
Block a user