feat(flutter): 重构播放页并增加语言切换
This commit is contained in:
1 parent
f1efbc5be8
commit
8c43e9e385
34 files changed
+1331
-879
No files matched your search
@@ -265,9 +265,16 @@ class MineVipCard extends StatelessWidget {
|
||||
|
||||
/// 我的页功能菜单。
|
||||
class MineMenuList extends StatelessWidget {
|
||||
const MineMenuList({super.key, required this.onOpen});
|
||||
const MineMenuList({
|
||||
super.key,
|
||||
required this.onOpen,
|
||||
required this.onLanguage,
|
||||
required this.languageLabel,
|
||||
});
|
||||
|
||||
final ValueChanged<MineDestination> onOpen;
|
||||
final VoidCallback onLanguage;
|
||||
final String languageLabel;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -313,6 +320,8 @@ class MineMenuList extends StatelessWidget {
|
||||
destination: MineDestination.settings,
|
||||
),
|
||||
_divider(),
|
||||
_languageRow(context),
|
||||
_divider(),
|
||||
_row(
|
||||
key: const Key('mine-help'),
|
||||
icon: Icons.help_outline_rounded,
|
||||
@@ -325,6 +334,43 @@ class MineMenuList extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _languageRow(BuildContext context) {
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
return ListTile(
|
||||
key: const Key('mine-language'),
|
||||
minTileHeight: 48,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 14),
|
||||
leading: const Icon(
|
||||
Icons.language_rounded,
|
||||
color: AppColors.blue,
|
||||
size: 20,
|
||||
),
|
||||
title: Text(
|
||||
l10n.language,
|
||||
style: const TextStyle(
|
||||
color: AppColors.onSurface,
|
||||
fontSize: AppDimens.body,
|
||||
),
|
||||
),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
languageLabel,
|
||||
style: const TextStyle(color: AppColors.muted, fontSize: 11),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
const Icon(
|
||||
Icons.chevron_right_rounded,
|
||||
color: AppColors.subtle,
|
||||
size: 18,
|
||||
),
|
||||
],
|
||||
),
|
||||
onTap: onLanguage,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _row({
|
||||
required Key key,
|
||||
required IconData icon,
|
||||
|
||||
Reference in new issue
Block a user