统一弹窗风格:Material Design 3 规范,消除颜色不一致

- 所有 AlertDialog 替换为 ModernDialog
- ConfirmDialog/AssetDialogs 去掉 GlassPanel,统一 surfaceContainer 背景
- 按钮统一 FilledButton + TextButton
- 修复 import 路径
This commit is contained in:
2026-04-16 11:47:17 +08:00
parent 491fcfdb5d
commit 1793fb727e
32 changed files with 75614 additions and 69129 deletions

View File

@@ -9,8 +9,7 @@ import '../../../../core/theme/app_color_scheme.dart';
import '../../../../core/theme/app_spacing.dart';
import '../../../../core/utils/toast_utils.dart';
import '../../../../providers/asset_provider.dart';
import '../../../components/glass_panel.dart';
import '../../../components/neon_glow.dart';
import '../../../shared/ui_constants.dart';
// ============================================
@@ -135,10 +134,13 @@ void showDepositDialog(BuildContext context) {
showDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.xl),
),
backgroundColor: colorScheme.surfaceContainer,
child: Container(
padding: const EdgeInsets.all(AppSpacing.lg),
constraints: const BoxConstraints(maxWidth: 400),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -198,19 +200,17 @@ void showDepositDialog(BuildContext context) {
Row(
children: [
Expanded(
child: NeonButton(
text: '取消',
type: NeonButtonType.outline,
child: TextButton(
onPressed: () => Navigator.of(ctx).pop(),
height: 48,
showGlow: false,
style: TextButton.styleFrom(
minimumSize: const Size.fromHeight(48),
),
child: const Text('取消'),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: NeonButton(
text: '下一步',
type: NeonButtonType.primary,
child: FilledButton(
onPressed: () async {
if (formKey.currentState!.validate()) {
Navigator.of(ctx).pop();
@@ -226,8 +226,10 @@ void showDepositDialog(BuildContext context) {
}
}
},
height: 48,
showGlow: true,
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(48),
),
child: const Text('下一步'),
),
),
],
@@ -250,18 +252,21 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
showDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.xl),
),
backgroundColor: colorScheme.surfaceContainer,
child: Container(
padding: const EdgeInsets.all(AppSpacing.lg),
constraints: const BoxConstraints(maxWidth: 400),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
NeonIcon(
icon: Icons.check_circle,
Icon(
Icons.check_circle,
color: context.appColors.up,
size: 24,
),
@@ -316,19 +321,17 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
Row(
children: [
Expanded(
child: NeonButton(
text: '稍後確認',
type: NeonButtonType.outline,
child: TextButton(
onPressed: () => Navigator.of(ctx).pop(),
height: 44,
showGlow: false,
style: TextButton.styleFrom(
minimumSize: const Size.fromHeight(44),
),
child: const Text('稍後確認'),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: NeonButton(
text: '已打款',
type: NeonButtonType.primary,
child: FilledButton(
onPressed: () async {
Navigator.of(ctx).pop();
final response = await context.read<AssetProvider>().confirmPay(orderNo);
@@ -340,8 +343,10 @@ void showDepositResultDialog(BuildContext context, Map<String, dynamic> data) {
);
}
},
height: 44,
showGlow: true,
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(44),
),
child: const Text('已打款'),
),
),
],
@@ -386,10 +391,13 @@ void showWithdrawDialog(BuildContext context, String? balance) {
showDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.xl),
),
backgroundColor: colorScheme.surfaceContainer,
child: Container(
padding: const EdgeInsets.all(AppSpacing.lg),
constraints: const BoxConstraints(maxWidth: 400),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
@@ -562,19 +570,17 @@ void showWithdrawDialog(BuildContext context, String? balance) {
Row(
children: [
Expanded(
child: NeonButton(
text: '取消',
type: NeonButtonType.outline,
child: TextButton(
onPressed: () => Navigator.of(ctx).pop(),
height: 44,
showGlow: false,
style: TextButton.styleFrom(
minimumSize: const Size.fromHeight(44),
),
child: const Text('取消'),
),
),
const SizedBox(width: AppSpacing.sm),
Expanded(
child: NeonButton(
text: '提交',
type: NeonButtonType.primary,
child: FilledButton(
onPressed: () async {
if (formKey.currentState!.validate()) {
Navigator.of(ctx).pop();
@@ -595,8 +601,10 @@ void showWithdrawDialog(BuildContext context, String? balance) {
}
}
},
height: 44,
showGlow: true,
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(44),
),
child: const Text('提交'),
),
),
],
@@ -628,10 +636,13 @@ void showResultDialog(BuildContext context, String title, String? message) {
showDialog(
context: context,
builder: (ctx) => Dialog(
backgroundColor: Colors.transparent,
child: GlassPanel(
borderRadius: BorderRadius.circular(AppRadius.lg),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadius.xl),
),
backgroundColor: colorScheme.surfaceContainer,
child: Container(
padding: const EdgeInsets.all(AppSpacing.lg),
constraints: const BoxConstraints(maxWidth: 400),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -654,12 +665,12 @@ void showResultDialog(BuildContext context, String title, String? message) {
const SizedBox(height: AppSpacing.lg),
SizedBox(
width: double.infinity,
child: NeonButton(
text: '確定',
type: NeonButtonType.primary,
child: FilledButton(
onPressed: () => Navigator.of(ctx).pop(),
height: 44,
showGlow: false,
style: FilledButton.styleFrom(
minimumSize: const Size.fromHeight(44),
),
child: const Text('確定'),
),
),
],