feat(ui): 优化组件样式并添加现代弹窗模板
- 更新 trade_button.dart 使用新颜色系统 - 更新 coin_card.dart 使用新颜色系统 - 更新 asset_card.dart 使用新颜色系统 - 创建 modern_dialog.dart 现代弹窗模板 - 创建 modern_bottom_sheet.dart 现代底部抽屉模板 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import '../../core/theme/app_colors.dart';
|
||||
import '../../core/theme/app_color_scheme.dart';
|
||||
|
||||
/// 资产卡片组件 - 用于显示资产总览
|
||||
class AssetCard extends StatelessWidget {
|
||||
@@ -13,9 +13,9 @@ class AssetCard extends StatelessWidget {
|
||||
final Gradient? gradient;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
// 默认渐变色 - 使用品牌蓝
|
||||
// 默认渐变色 - 使用品牌青绿色
|
||||
static const defaultGradient = LinearGradient(
|
||||
colors: [Color(0xFF2563EB), Color(0xFF1D4ED8)],
|
||||
colors: [AppColorScheme.primaryDark, Color(0xFF00B894)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
);
|
||||
@@ -54,7 +54,7 @@ class AssetCard extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
color: Colors.black.withValues(alpha: 0.1),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
@@ -72,7 +72,7 @@ class AssetCard extends StatelessWidget {
|
||||
),
|
||||
const Spacer(),
|
||||
if (onTap != null)
|
||||
Icon(
|
||||
const Icon(
|
||||
LucideIcons.chevronRight,
|
||||
color: Colors.white70,
|
||||
size: 18,
|
||||
@@ -161,9 +161,6 @@ class AssetCardCompact extends StatelessWidget {
|
||||
final bool? isUp;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
static const upColor = Color(0xFF00C853);
|
||||
static const downColor = Color(0xFFFF5252);
|
||||
|
||||
const AssetCardCompact({
|
||||
super.key,
|
||||
required this.title,
|
||||
@@ -176,6 +173,7 @@ class AssetCardCompact extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = ShadTheme.of(context);
|
||||
final isValueUp = isUp ?? true;
|
||||
|
||||
return ShadCard(
|
||||
padding: const EdgeInsets.all(16),
|
||||
@@ -205,13 +203,13 @@ class AssetCardCompact extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: (isUp ?? true) ? upColor.withOpacity(0.2) : downColor.withOpacity(0.2),
|
||||
color: getChangeBackgroundColor(isValueUp),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
change!,
|
||||
style: TextStyle(
|
||||
color: (isUp ?? true) ? upColor : downColor,
|
||||
color: getChangeColor(isValueUp),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import '../../core/constants/app_colors.dart';
|
||||
import '../../core/theme/app_color_scheme.dart';
|
||||
|
||||
/// 币种卡片组件 - 用于显示币种信息
|
||||
class CoinCard extends StatelessWidget {
|
||||
@@ -38,7 +38,7 @@ class CoinCard extends StatelessWidget {
|
||||
width: 44,
|
||||
height: 44,
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primary.withOpacity(0.1),
|
||||
color: theme.colorScheme.primary.withValues(alpha: 0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
@@ -75,13 +75,13 @@ class CoinCard extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.getChangeBackgroundColor(isUp),
|
||||
color: getChangeBackgroundColor(isUp),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Text(
|
||||
change,
|
||||
style: TextStyle(
|
||||
color: AppColors.getChangeColor(isUp),
|
||||
color: getChangeColor(isUp),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import '../../core/theme/app_color_scheme.dart';
|
||||
|
||||
/// 交易按钮组件 - 买入/卖出按钮
|
||||
class TradeButton extends StatelessWidget {
|
||||
@@ -9,10 +10,6 @@ class TradeButton extends StatelessWidget {
|
||||
final bool isLoading;
|
||||
final bool fullWidth;
|
||||
|
||||
// 颜色常量
|
||||
static const buyColor = Color(0xFF00C853);
|
||||
static const sellColor = Color(0xFFFF5252);
|
||||
|
||||
const TradeButton({
|
||||
super.key,
|
||||
this.isBuy = true,
|
||||
@@ -42,7 +39,7 @@ class TradeButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final color = isBuy ? buyColor : sellColor;
|
||||
final color = isBuy ? AppColorScheme.up : AppColorScheme.down;
|
||||
final text = isBuy ? '买入${coinCode != null ? ' $coinCode' : ''}' : '卖出${coinCode != null ? ' $coinCode' : ''}';
|
||||
final icon = isBuy ? LucideIcons.arrowDownToLine : LucideIcons.arrowUpFromLine;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user