111
This commit is contained in:
@@ -2,13 +2,13 @@ import 'package:flutter/material.dart';
|
||||
import '../../core/theme/app_color_scheme.dart';
|
||||
import '../../core/theme/app_spacing.dart';
|
||||
|
||||
/// 交易按钮组件 - 买入/卖出按钮
|
||||
/// 交易按鈕組件 - 買入/賣出按鈕
|
||||
///
|
||||
/// 设计规则:
|
||||
/// - 渐变按钮: 135度渐变
|
||||
/// - 圆角: xxl (24px / 1.5rem)
|
||||
/// - 买入: 翡翠绿渐变
|
||||
/// - 卖出: 红色渐变
|
||||
/// 設計規則:
|
||||
/// - 漸變按鈕: 135度漸變
|
||||
/// - 圓角: xxl (24px / 1.5rem)
|
||||
/// - 買入: 翡翠綠漸變
|
||||
/// - 賣出: 紅色漸變
|
||||
class TradeButton extends StatelessWidget {
|
||||
final bool isBuy;
|
||||
final String? coinCode;
|
||||
@@ -25,7 +25,7 @@ class TradeButton extends StatelessWidget {
|
||||
this.fullWidth = false,
|
||||
});
|
||||
|
||||
/// 买入按钮
|
||||
/// 買入按鈕
|
||||
const TradeButton.buy({
|
||||
super.key,
|
||||
this.coinCode,
|
||||
@@ -34,7 +34,7 @@ class TradeButton extends StatelessWidget {
|
||||
this.fullWidth = false,
|
||||
}) : isBuy = true;
|
||||
|
||||
/// 卖出按钮
|
||||
/// 賣出按鈕
|
||||
const TradeButton.sell({
|
||||
super.key,
|
||||
this.coinCode,
|
||||
@@ -48,10 +48,10 @@ class TradeButton extends StatelessWidget {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
final gradient = isBuy ? AppColorScheme.buyGradient : AppColorScheme.sellGradient;
|
||||
final text = isBuy
|
||||
? '买入${coinCode != null ? ' $coinCode' : ''}'
|
||||
: '卖出${coinCode != null ? ' $coinCode' : ''}';
|
||||
? '買入${coinCode != null ? ' $coinCode' : ''}'
|
||||
: '賣出${coinCode != null ? ' $coinCode' : ''}';
|
||||
|
||||
// 主题感知颜色 - 在渐变背景上使用 onPrimary
|
||||
// 主題感知顏色 - 在漸變背景上使用 onPrimary
|
||||
final textColor = colorScheme.onPrimary;
|
||||
|
||||
return Container(
|
||||
@@ -103,7 +103,7 @@ class TradeButton extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// 交易按钮组 - 同时显示买入和卖出按钮
|
||||
/// 交易按鈕組 - 同時顯示買入和賣出按鈕
|
||||
class TradeButtonGroup extends StatelessWidget {
|
||||
final String? coinCode;
|
||||
final VoidCallback? onBuyPressed;
|
||||
|
||||
Reference in New Issue
Block a user