统一弹窗风格:Material Design 3 规范,消除颜色不一致
- 所有 AlertDialog 替换为 ModernDialog - ConfirmDialog/AssetDialogs 去掉 GlassPanel,统一 surfaceContainer 背景 - 按钮统一 FilledButton + TextButton - 修复 import 路径
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:lucide_icons_flutter/lucide_icons.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../../../core/theme/app_spacing.dart';
|
||||
import '../../../core/theme/app_theme_extension.dart';
|
||||
@@ -9,6 +8,7 @@ import '../../../providers/market_provider.dart';
|
||||
import '../../../providers/asset_provider.dart';
|
||||
import '../../../data/services/trade_service.dart';
|
||||
import '../../components/neon_glow.dart';
|
||||
import '../../shared/modern_dialog.dart';
|
||||
import 'components/coin_selector.dart';
|
||||
import 'components/price_card.dart';
|
||||
import 'components/placeholder_card.dart';
|
||||
@@ -283,30 +283,26 @@ class _TradePageState extends State<TradePage>
|
||||
}
|
||||
|
||||
void _showResultDialog(bool success, String title, String message) {
|
||||
showDialog(
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
ModernDialog.show(
|
||||
context: context,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: Row(
|
||||
children: [
|
||||
NeonIcon(
|
||||
icon: success ? Icons.check_circle : Icons.error,
|
||||
color: success
|
||||
? ctx.appColors.up
|
||||
: Theme.of(ctx).colorScheme.error,
|
||||
size: 24,
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm),
|
||||
Text(title),
|
||||
],
|
||||
),
|
||||
content: Text(message),
|
||||
actions: [
|
||||
TextButton(
|
||||
child: const Text('確定'),
|
||||
onPressed: () => Navigator.of(ctx).pop(),
|
||||
titleWidget: Row(
|
||||
children: [
|
||||
NeonIcon(
|
||||
icon: success ? Icons.check_circle : Icons.error,
|
||||
color: success
|
||||
? context.appColors.up
|
||||
: colorScheme.error,
|
||||
size: 24,
|
||||
),
|
||||
SizedBox(width: AppSpacing.sm),
|
||||
Text(title),
|
||||
],
|
||||
),
|
||||
description: message,
|
||||
actions: [
|
||||
ModernDialogAction(label: '確定', isPrimary: true),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user