refactor(account): 收敛账号页组件结构
This commit is contained in:
1 parent
da095115d4
commit
6fce24d9ec
5 files changed
+308
-247
No files matched your search
@@ -24,10 +24,7 @@ import '../watch_records/watch_records_page.dart';
|
||||
import '../favorites/favorites_page.dart';
|
||||
import '../notices/notices_page.dart';
|
||||
import '../downloads/downloads_page.dart';
|
||||
import '../account/account_profile_page.dart';
|
||||
import '../account/account_devices_page.dart';
|
||||
import '../account/account_export_page.dart';
|
||||
import '../account/account_deactivate_page.dart';
|
||||
import '../account/account_entry_card.dart';
|
||||
|
||||
class MyPage extends StatefulWidget {
|
||||
const MyPage({
|
||||
@@ -206,7 +203,7 @@ class _MyPageState extends State<MyPage> {
|
||||
const SizedBox(height: 18),
|
||||
_wallet(l10n),
|
||||
const SizedBox(height: 14),
|
||||
_accountCard(l10n),
|
||||
const AccountEntryCard(),
|
||||
],
|
||||
const SizedBox(height: 14),
|
||||
_menuCard(l10n),
|
||||
@@ -496,66 +493,6 @@ class _MyPageState extends State<MyPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _accountCard(AppLocalizations l10n) {
|
||||
return Material(
|
||||
key: const Key('mine-account-card'),
|
||||
color: AppColors.card,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
clipBehavior: Clip.antiAlias,
|
||||
child: Column(
|
||||
children: [
|
||||
ListTile(
|
||||
key: const Key('mine-account-profile'),
|
||||
leading: const Icon(
|
||||
Icons.person_outline_rounded,
|
||||
color: AppColors.blueSoft,
|
||||
),
|
||||
title: Text(l10n.accountProfile),
|
||||
trailing: const Icon(Icons.chevron_right_rounded),
|
||||
onTap: () => _openAccount(const AccountProfilePage()),
|
||||
),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
key: const Key('mine-account-devices'),
|
||||
leading: const Icon(
|
||||
Icons.devices_other_rounded,
|
||||
color: AppColors.blueSoft,
|
||||
),
|
||||
title: Text(l10n.accountDevices),
|
||||
trailing: const Icon(Icons.chevron_right_rounded),
|
||||
onTap: () => _openAccount(const AccountDevicesPage()),
|
||||
),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
key: const Key('mine-account-export'),
|
||||
leading: const Icon(
|
||||
Icons.file_download_outlined,
|
||||
color: AppColors.blueSoft,
|
||||
),
|
||||
title: Text(l10n.accountDataExport),
|
||||
trailing: const Icon(Icons.chevron_right_rounded),
|
||||
onTap: () => _openAccount(const AccountExportPage()),
|
||||
),
|
||||
const Divider(height: 1, color: AppColors.outlineVariantDark),
|
||||
ListTile(
|
||||
key: const Key('mine-account-deactivate'),
|
||||
leading: const Icon(
|
||||
Icons.person_remove_outlined,
|
||||
color: AppColors.blueSoft,
|
||||
),
|
||||
title: Text(l10n.accountDeactivate),
|
||||
trailing: const Icon(Icons.chevron_right_rounded),
|
||||
onTap: () => _openAccount(const AccountDeactivatePage()),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _openAccount(Widget page) {
|
||||
Navigator.of(context).push<void>(MaterialPageRoute(builder: (_) => page));
|
||||
}
|
||||
|
||||
Widget _library(
|
||||
AppLocalizations l10n,
|
||||
Duration position,
|
||||
|
||||
Reference in new issue
Block a user