统一弹窗风格:Material Design 3 规范,消除颜色不一致
- 所有 AlertDialog 替换为 ModernDialog - ConfirmDialog/AssetDialogs 去掉 GlassPanel,统一 surfaceContainer 背景 - 按钮统一 FilledButton + TextButton - 修复 import 路径
This commit is contained in:
@@ -2,8 +2,6 @@ import 'package:flutter/material.dart';
|
||||
import '../../../../core/theme/app_spacing.dart';
|
||||
import '../../../../core/theme/app_theme.dart';
|
||||
import '../../../../core/theme/app_theme_extension.dart';
|
||||
import '../../../components/glass_panel.dart';
|
||||
import '../../../components/neon_glow.dart';
|
||||
|
||||
/// 交易確認對話框
|
||||
///
|
||||
@@ -27,15 +25,19 @@ class ConfirmDialog extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final actionColor = isBuy
|
||||
? context.appColors.up
|
||||
: context.appColors.down;
|
||||
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
child: GlassPanel(
|
||||
borderRadius: BorderRadius.circular(AppRadius.lg),
|
||||
padding: EdgeInsets.all(AppSpacing.lg),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppRadius.xl),
|
||||
),
|
||||
backgroundColor: theme.colorScheme.surfaceContainer,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(AppSpacing.lg),
|
||||
constraints: const BoxConstraints(maxWidth: 400),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -59,22 +61,23 @@ class ConfirmDialog extends StatelessWidget {
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: NeonButton(
|
||||
text: '取消',
|
||||
type: NeonButtonType.outline,
|
||||
child: TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
height: 44,
|
||||
showGlow: false,
|
||||
style: TextButton.styleFrom(
|
||||
minimumSize: const Size.fromHeight(44),
|
||||
),
|
||||
child: const Text('取消'),
|
||||
),
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm),
|
||||
Expanded(
|
||||
child: NeonButton(
|
||||
text: '確認${isBuy ? '買入' : '賣出'}',
|
||||
type: isBuy ? NeonButtonType.tertiary : NeonButtonType.error,
|
||||
child: FilledButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
height: 44,
|
||||
showGlow: true,
|
||||
style: FilledButton.styleFrom(
|
||||
backgroundColor: actionColor,
|
||||
minimumSize: const Size.fromHeight(44),
|
||||
),
|
||||
child: Text('確認${isBuy ? '買入' : '賣出'}'),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user