fix:UI对齐demo

This commit is contained in:
jingyun
2026-06-18 18:08:29 +08:00
parent f42ad566e0
commit 2d7523f901
14 changed files with 1613 additions and 355 deletions
@@ -6,6 +6,7 @@ import 'package:url_launcher/url_launcher_string.dart';
import '../../../common/config/app_h5_urls.dart';
import '../../../common/router/app_router.dart';
import '../../../common/widgets/app_toast.dart';
import '../../../common/widgets/prototype_ui.dart';
import '../../auth/application/auth_controller.dart';
import '../../auth/data/auth_models.dart';
@@ -140,14 +141,7 @@ class ProfilePage extends ConsumerWidget {
backgroundColor: const Color(0xFFEAF2ED),
iconColor: const Color(0xFF5E8E75),
),
],
),
),
const SizedBox(height: 12),
PrototypeCard(
padding: EdgeInsets.zero,
child: Column(
children: [
const PrototypeDivider(margin: EdgeInsets.zero),
_SettingRow(
icon: Icons.grid_view_outlined,
title: '添加桌面小组件',
@@ -156,7 +150,14 @@ class ProfilePage extends ConsumerWidget {
backgroundColor: const Color(0xFFF6ECD6),
iconColor: const Color(0xFFB5862A),
),
const PrototypeDivider(margin: EdgeInsets.zero),
],
),
),
const SizedBox(height: 12),
PrototypeCard(
padding: EdgeInsets.zero,
child: Column(
children: [
_SettingRow(
icon: Icons.tune_outlined,
title: '纯度系数管理',
@@ -180,7 +181,17 @@ class ProfilePage extends ConsumerWidget {
icon: Icons.palette_outlined,
title: '涨跌颜色',
trailing: settings.priceColorMode.label,
onTap: () => _showPriceColorSheet(context, ref),
onTap: () {
final nextMode =
settings.priceColorMode ==
PriceColorMode.redUpGreenDown
? PriceColorMode.greenUpRedDown
: PriceColorMode.redUpGreenDown;
ref
.read(profileSettingsControllerProvider.notifier)
.setPriceColorMode(nextMode);
_toast(context, '已切换为「${nextMode.label}');
},
backgroundColor: const Color(0xFFE9F3F1),
iconColor: const Color(0xFF4E8B7B),
),
@@ -189,7 +200,7 @@ class ProfilePage extends ConsumerWidget {
icon: Icons.currency_yen_outlined,
title: '显示币种',
trailing: '¥ CNY',
onTap: () => _showCurrencySheet(context),
onTap: () => _toast(context, '当前仅支持 ¥ CNY'),
backgroundColor: const Color(0xFFF1EFE9),
iconColor: const Color(0xFF7F7A73),
),
@@ -293,10 +304,6 @@ class ProfilePage extends ConsumerWidget {
context.push(AppRoutes.profileWidget);
}
Future<void> _showPriceColorSheet(BuildContext context, WidgetRef ref) async {
context.push(AppRoutes.profilePriceColor);
}
Future<void> _showPuritySheet(
BuildContext context,
ProfileSettings settings,
@@ -311,15 +318,15 @@ class ProfilePage extends ConsumerWidget {
context.push(AppRoutes.profileRecycle);
}
Future<void> _showCurrencySheet(BuildContext context) async {
context.push(AppRoutes.profileCurrency);
}
void _showAbout(BuildContext context) {
context.push(AppRoutes.profileAbout);
}
}
void _toast(BuildContext context, String message) {
toastInfo(msg: message);
}
class _MenuRow extends StatelessWidget {
const _MenuRow({
required this.title,