feat(theme): migrate to new theme system with static color methods
- Convert instance methods to static methods in AppColorScheme for getChangeColor and getChangeBackgroundColor - Update main.dart to use ShadThemeData with AppColorScheme color schemes instead of createLight/DarkShadTheme functions - Add app_theme.dart import to main.dart - Refactor asset_card.dart and coin_card.dart to call static methods via AppColorScheme class - Add app_spacing.dart import to action_buttons_row.dart - Replace SizedBox with proper spacing constants in action buttons row
This commit is contained in:
@@ -49,14 +49,14 @@ class ConfirmDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
SizedBox(height: AppSpacing.lg),
|
||||
_dialogRow('交易对', '$coinCode/USDT', colorScheme),
|
||||
_dialogRow(context, '交易对', '$coinCode/USDT', colorScheme),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
_dialogRow('委托价格', '$price USDT', colorScheme),
|
||||
_dialogRow(context, '委托价格', '$price USDT', colorScheme),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
_dialogRow('交易金额', '$amount USDT', colorScheme,
|
||||
_dialogRow(context, '交易金额', '$amount USDT', colorScheme,
|
||||
valueColor: actionColor),
|
||||
SizedBox(height: AppSpacing.sm),
|
||||
_dialogRow('交易数量', '$quantity $coinCode', colorScheme),
|
||||
_dialogRow(context, '交易数量', '$quantity $coinCode', colorScheme),
|
||||
SizedBox(height: AppSpacing.lg),
|
||||
Row(
|
||||
children: [
|
||||
@@ -87,7 +87,7 @@ class ConfirmDialog extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _dialogRow(String label, String value, ColorScheme colorScheme,
|
||||
Widget _dialogRow(BuildContext context, String label, String value, ColorScheme colorScheme,
|
||||
{Color? valueColor}) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
||||
@@ -172,13 +172,13 @@ class TradeFormCard extends StatelessWidget {
|
||||
// 设计稿:gap:8,圆角sm,bg-tertiary,高32
|
||||
Row(
|
||||
children: [
|
||||
_buildPctButton('25%', 0.25, colorScheme),
|
||||
_buildPctButton(context, '25%', 0.25, colorScheme),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
_buildPctButton('50%', 0.5, colorScheme),
|
||||
_buildPctButton(context, '50%', 0.5, colorScheme),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
_buildPctButton('75%', 0.75, colorScheme),
|
||||
_buildPctButton(context, '75%', 0.75, colorScheme),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
_buildPctButton('100%', 1.0, colorScheme),
|
||||
_buildPctButton(context, '100%', 1.0, colorScheme),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: AppSpacing.md + AppSpacing.sm),
|
||||
@@ -203,7 +203,7 @@ class TradeFormCard extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// 百分比按钮 - 设计稿:圆角sm,bg-tertiary,高32
|
||||
Widget _buildPctButton(String label, double pct, ColorScheme colorScheme) {
|
||||
Widget _buildPctButton(BuildContext context, String label, double pct, ColorScheme colorScheme) {
|
||||
return Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: () => onFillPercent(pct),
|
||||
|
||||
Reference in New Issue
Block a user