diff --git a/frontend/mobile-app/lib/features/account/presentation/pages/account_switch_page.dart b/frontend/mobile-app/lib/features/account/presentation/pages/account_switch_page.dart index db3031b5..41f6bed3 100644 --- a/frontend/mobile-app/lib/features/account/presentation/pages/account_switch_page.dart +++ b/frontend/mobile-app/lib/features/account/presentation/pages/account_switch_page.dart @@ -273,13 +273,19 @@ class _AccountSwitchPageState extends ConsumerState { children: [ Row( children: [ - Text( - account.username, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w600, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + account.username, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFF5D4037), + ), + ), ), ), if (isCurrent) ...[ @@ -306,12 +312,16 @@ class _AccountSwitchPageState extends ConsumerState { ], ), const SizedBox(height: 4), - Text( - account.userSerialNum, - style: const TextStyle( - fontSize: 12, - fontFamily: 'Inter', - color: Color(0x995D4037), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + account.userSerialNum, + style: const TextStyle( + fontSize: 12, + fontFamily: 'Inter', + color: Color(0x995D4037), + ), ), ), ], diff --git a/frontend/mobile-app/lib/features/auth/presentation/pages/wallet_created_page.dart b/frontend/mobile-app/lib/features/auth/presentation/pages/wallet_created_page.dart index b92c721f..19be4972 100644 --- a/frontend/mobile-app/lib/features/auth/presentation/pages/wallet_created_page.dart +++ b/frontend/mobile-app/lib/features/auth/presentation/pages/wallet_created_page.dart @@ -304,14 +304,18 @@ class WalletCreatedPage extends ConsumerWidget { const SizedBox(width: 14), // 标签和值 - 单行显示 "标签: 值" Expanded( - child: Text( - '$label: $displayValue', - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w500, - height: 1.5, - color: Color(0xFF5D4037), + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + '$label: $displayValue', + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + height: 1.5, + color: Color(0xFF5D4037), + ), ), ), ), diff --git a/frontend/mobile-app/lib/features/authorization/presentation/pages/authorization_apply_page.dart b/frontend/mobile-app/lib/features/authorization/presentation/pages/authorization_apply_page.dart index 56a2d6af..8efd3ac3 100644 --- a/frontend/mobile-app/lib/features/authorization/presentation/pages/authorization_apply_page.dart +++ b/frontend/mobile-app/lib/features/authorization/presentation/pages/authorization_apply_page.dart @@ -832,12 +832,16 @@ class _AuthorizationApplyPageState ), ), const SizedBox(height: 4), - Text( - _hasPlanted ? '累计认种 $_plantedCount 棵' : '请先完成认种后再申请授权', - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - color: Color(0xFF745D43), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + _hasPlanted ? '累计认种 $_plantedCount 棵' : '请先完成认种后再申请授权', + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + color: Color(0xFF745D43), + ), ), ), ], diff --git a/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart b/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart index 4c948ebc..77a328f9 100644 --- a/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart +++ b/frontend/mobile-app/lib/features/authorization/presentation/widgets/stickman_race_widget.dart @@ -248,6 +248,7 @@ class _StickmanRaceWidgetState extends State children: [ // 完成数量标签 Container( + constraints: const BoxConstraints(maxWidth: 60), padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2), decoration: BoxDecoration( color: data.isCurrentUser @@ -255,13 +256,16 @@ class _StickmanRaceWidgetState extends State : const Color(0xFF8B5A2B), borderRadius: BorderRadius.circular(8), ), - child: Text( - '${_formatNumber(data.completedCount)}棵', - style: const TextStyle( - fontSize: 9, - fontFamily: 'Inter', - fontWeight: FontWeight.w600, - color: Colors.white, + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '${_formatNumber(data.completedCount)}棵', + style: const TextStyle( + fontSize: 9, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Colors.white, + ), ), ), ), @@ -481,12 +485,16 @@ class _StickmanRaceWidgetState extends State ], ), const SizedBox(height: 2), - Text( - '本月收益: ${_formatCurrency(data.monthlyEarnings)} 绿积分', - style: const TextStyle( - fontSize: 11, - fontFamily: 'Inter', - color: Color(0xFF8B5A2B), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + '本月收益: ${_formatCurrency(data.monthlyEarnings)} 绿积分', + style: const TextStyle( + fontSize: 11, + fontFamily: 'Inter', + color: Color(0xFF8B5A2B), + ), ), ), ], @@ -494,28 +502,39 @@ class _StickmanRaceWidgetState extends State ), // 完成数量和进度 - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - '${_formatNumber(data.completedCount)}棵', - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFFD4AF37), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 100), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + '${_formatNumber(data.completedCount)}棵', + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFFD4AF37), + ), + ), ), - ), - const SizedBox(height: 2), - Text( - '${(data.progress * 100).toStringAsFixed(1)}%', - style: const TextStyle( - fontSize: 11, - fontFamily: 'Inter', - color: Color(0xFF8B5A2B), + const SizedBox(height: 2), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + '${(data.progress * 100).toStringAsFixed(1)}%', + style: const TextStyle( + fontSize: 11, + fontFamily: 'Inter', + color: Color(0xFF8B5A2B), + ), + ), ), - ), - ], + ], + ), ), ], ), diff --git a/frontend/mobile-app/lib/features/deposit/presentation/pages/deposit_usdt_page.dart b/frontend/mobile-app/lib/features/deposit/presentation/pages/deposit_usdt_page.dart index ae336339..a57f1bd8 100644 --- a/frontend/mobile-app/lib/features/deposit/presentation/pages/deposit_usdt_page.dart +++ b/frontend/mobile-app/lib/features/deposit/presentation/pages/deposit_usdt_page.dart @@ -378,13 +378,17 @@ class _DepositUsdtPageState extends ConsumerState { return Container( width: double.infinity, padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Text( - '可用余额: $_balance 绿积分', - style: TextStyle( - fontSize: 14, - fontFamily: 'Inter', - height: 1.5, - color: const Color(0xFF5D4037).withValues(alpha: 0.8), + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + '可用余额: $_balance 绿积分', + style: TextStyle( + fontSize: 14, + fontFamily: 'Inter', + height: 1.5, + color: const Color(0xFF5D4037).withValues(alpha: 0.8), + ), ), ), ); diff --git a/frontend/mobile-app/lib/features/mining/presentation/pages/mining_page.dart b/frontend/mobile-app/lib/features/mining/presentation/pages/mining_page.dart index 93693c6a..e82e81c1 100644 --- a/frontend/mobile-app/lib/features/mining/presentation/pages/mining_page.dart +++ b/frontend/mobile-app/lib/features/mining/presentation/pages/mining_page.dart @@ -420,15 +420,19 @@ class _MiningPageState extends ConsumerState { ], ) else if (_walletStatus == WalletCreationStatus.ready) - Text( - '序列号$_serialNumber', - style: const TextStyle( - fontSize: 20, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.25, - letterSpacing: -0.3, - color: Color(0xFF5D4037), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + '序列号$_serialNumber', + style: const TextStyle( + fontSize: 20, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.25, + letterSpacing: -0.3, + color: Color(0xFF5D4037), + ), ), ) else diff --git a/frontend/mobile-app/lib/features/planting/presentation/pages/planting_quantity_page.dart b/frontend/mobile-app/lib/features/planting/presentation/pages/planting_quantity_page.dart index 07d72ba4..869e9a1c 100644 --- a/frontend/mobile-app/lib/features/planting/presentation/pages/planting_quantity_page.dart +++ b/frontend/mobile-app/lib/features/planting/presentation/pages/planting_quantity_page.dart @@ -423,17 +423,20 @@ class _PlantingQuantityPageState extends ConsumerState { ), ), ) - : Text( - _formatNumber(_availableBalance), - style: const TextStyle( - fontSize: 36, - fontFamily: 'Inter', - fontWeight: FontWeight.w400, - height: 1.25, - letterSpacing: -0.54, - color: Color(0xFF5D4037), - ), - ), + : FittedBox( + fit: BoxFit.scaleDown, + child: Text( + _formatNumber(_availableBalance), + style: const TextStyle( + fontSize: 36, + fontFamily: 'Inter', + fontWeight: FontWeight.w400, + height: 1.25, + letterSpacing: -0.54, + color: Color(0xFF5D4037), + ), + ), + ), ], ), ); diff --git a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart index 852c2043..c07a4fa3 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart @@ -2029,14 +2029,20 @@ class _ProfilePageState extends ConsumerState { color: Color(0xCC5D4037), ), ), - Text( - _formatNumber(_pendingUsdt), - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w500, - height: 1.25, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + _formatNumber(_pendingUsdt), + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + height: 1.25, + color: Color(0xFF5D4037), + ), + ), ), ), ], @@ -2183,13 +2189,17 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(height: 8), // 第二行:金额信息 - Text( - amountText, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFF5D4037), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + amountText, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF5D4037), + ), ), ), // 第三行:备注信息 @@ -2310,13 +2320,17 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(height: 8), // 第二行:金额信息 - Text( - amountText, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFF5D4037), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + amountText, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF5D4037), + ), ), ), // 第三行:备注信息(如果有) @@ -2366,14 +2380,20 @@ class _ProfilePageState extends ConsumerState { color: Color(0xCC5D4037), ), ), - Text( - _formatNumber(_settleableUsdt), - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.5, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + _formatNumber(_settleableUsdt), + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.5, + color: Color(0xFF5D4037), + ), + ), ), ), ], @@ -2432,14 +2452,20 @@ class _ProfilePageState extends ConsumerState { color: Color(0xCC5D4037), ), ), - Text( - _formatNumber(_settledUsdt), - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.5, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + _formatNumber(_settledUsdt), + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.5, + color: Color(0xFF5D4037), + ), + ), ), ), ], @@ -2539,13 +2565,17 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(height: 8), // 第二行:金额信息 - Text( - amountText, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFF5D4037), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + amountText, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF5D4037), + ), ), ), ], @@ -2622,13 +2652,17 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(height: 8), // 第二行:金额信息 - Text( - amountText, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFF5D4037), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + amountText, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF5D4037), + ), ), ), ], @@ -2649,13 +2683,19 @@ class _ProfilePageState extends ConsumerState { color: Color(0xFF5D4037), ), ), - Text( - amountText, - style: const TextStyle( - fontSize: 13, - fontFamily: 'Inter', - fontWeight: FontWeight.w600, - color: Color(0xFF4CAF50), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + amountText, + style: const TextStyle( + fontSize: 13, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFF4CAF50), + ), + ), ), ), ], @@ -2705,14 +2745,20 @@ class _ProfilePageState extends ConsumerState { color: Color(0xCC5D4037), ), ), - Text( - _formatNumber(_expiredUsdt), - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.5, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + _formatNumber(_expiredUsdt), + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.5, + color: Color(0xFF5D4037), + ), + ), ), ), ], @@ -2853,13 +2899,17 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(height: 8), // 第二行:金额信息 - Text( - amountText, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFF999999), // 灰色文字 + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + amountText, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF999999), // 灰色文字 + ), ), ), ], @@ -2935,13 +2985,17 @@ class _ProfilePageState extends ConsumerState { ), const SizedBox(height: 8), // 第二行:金额信息 - Text( - amountText, - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - color: Color(0xFF999999), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + amountText, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF999999), + ), ), ), ], @@ -2962,13 +3016,19 @@ class _ProfilePageState extends ConsumerState { color: Color(0xFF999999), ), ), - Text( - amountText, - style: const TextStyle( - fontSize: 13, - fontFamily: 'Inter', - fontWeight: FontWeight.w600, - color: Color(0xFFE57373), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + amountText, + style: const TextStyle( + fontSize: 13, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFFE57373), + ), + ), ), ), ], diff --git a/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart b/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart index 1894256c..06f9e88a 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart @@ -240,13 +240,16 @@ class _TeamTreeWidgetState extends State { ), const SizedBox(height: 2), // 个人/团队认种数 - Text( - '${node.personalPlantingCount}/${node.teamPlantingCount}', - style: const TextStyle( - fontSize: 11, - fontFamily: 'Inter', - fontWeight: FontWeight.w500, - color: Color(0xCC5D4037), + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '${node.personalPlantingCount}/${node.teamPlantingCount}', + style: const TextStyle( + fontSize: 11, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + color: Color(0xCC5D4037), + ), ), ), const SizedBox(height: 4), @@ -303,13 +306,16 @@ class _TeamTreeWidgetState extends State { color: Color(0xFF666666), ), ), - Text( - '+${hiddenNodes.length}', - style: const TextStyle( - fontSize: 11, - fontFamily: 'Inter', - fontWeight: FontWeight.w500, - color: Color(0xFF666666), + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '+${hiddenNodes.length}', + style: const TextStyle( + fontSize: 11, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + color: Color(0xFF666666), + ), ), ), ], @@ -534,12 +540,16 @@ class _HiddenNodesSheet extends StatelessWidget { color: Color(0xFF5D4037), ), ), - subtitle: Text( - '个人/团队: ${node.personalPlantingCount}/${node.teamPlantingCount}', - style: const TextStyle( - fontSize: 12, - fontFamily: 'Inter', - color: Color(0xCC5D4037), + subtitle: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + '个人/团队: ${node.personalPlantingCount}/${node.teamPlantingCount}', + style: const TextStyle( + fontSize: 12, + fontFamily: 'Inter', + color: Color(0xCC5D4037), + ), ), ), trailing: node.hasChildren @@ -740,13 +750,19 @@ class _NodeDetailsSheet extends StatelessWidget { color: Color(0xFF8B5A2B), ), ), - Text( - value, - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - fontWeight: FontWeight.w600, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + value, + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFF5D4037), + ), + ), ), ), ], diff --git a/frontend/mobile-app/lib/features/ranking/presentation/pages/ranking_page.dart b/frontend/mobile-app/lib/features/ranking/presentation/pages/ranking_page.dart index ada0cb41..c71aaad9 100644 --- a/frontend/mobile-app/lib/features/ranking/presentation/pages/ranking_page.dart +++ b/frontend/mobile-app/lib/features/ranking/presentation/pages/ranking_page.dart @@ -381,29 +381,36 @@ class _RankingPageState extends ConsumerState { ), ), // 团队认种量 - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - _formatNumber(item.teamPlantingAmount), - style: const TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.5, - color: Color(0xFFD4AF37), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 100), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + _formatNumber(item.teamPlantingAmount), + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.5, + color: Color(0xFFD4AF37), + ), + ), ), - ), - const Text( - '团队认种量', - style: TextStyle( - fontSize: 12, - fontFamily: 'Inter', - height: 1.5, - color: Color(0xFF8B5A2B), + const Text( + '团队认种量', + style: TextStyle( + fontSize: 12, + fontFamily: 'Inter', + height: 1.5, + color: Color(0xFF8B5A2B), + ), ), - ), - ], + ], + ), ), ], ), diff --git a/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart b/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart index b9b75ef5..608a0b26 100644 --- a/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart +++ b/frontend/mobile-app/lib/features/trading/presentation/pages/ledger_detail_page.dart @@ -440,14 +440,20 @@ class _LedgerDetailPageState extends ConsumerState color: Color(0xFF5D4037), ), ), - Text( - '${(stats?.netAmount ?? 0) >= 0 ? '+' : ''}${_formatAmount(stats?.netAmount ?? 0)} 绿积分', - style: TextStyle( - fontSize: 18, - fontWeight: FontWeight.w700, - color: (stats?.netAmount ?? 0) >= 0 - ? const Color(0xFF4CAF50) - : const Color(0xFFE53935), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + '${(stats?.netAmount ?? 0) >= 0 ? '+' : ''}${_formatAmount(stats?.netAmount ?? 0)} 绿积分', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + color: (stats?.netAmount ?? 0) >= 0 + ? const Color(0xFF4CAF50) + : const Color(0xFFE53935), + ), + ), ), ), ], @@ -485,12 +491,15 @@ class _LedgerDetailPageState extends ConsumerState ], ), const SizedBox(height: 8), - Text( - _formatAmount(amount), - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w700, - color: color, + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + _formatAmount(amount), + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w700, + color: color, + ), ), ), const Text( @@ -662,12 +671,15 @@ class _LedgerDetailPageState extends ConsumerState ), ), const SizedBox(height: 4), - Text( - _formatAmount(amount), - style: TextStyle( - fontSize: 12, - fontWeight: FontWeight.w600, - color: color, + FittedBox( + fit: BoxFit.scaleDown, + child: Text( + _formatAmount(amount), + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: color, + ), ), ), ], @@ -760,12 +772,18 @@ class _LedgerDetailPageState extends ConsumerState ], ), ), - Text( - '${isIncome ? '+' : ''}${_formatAmount(item.totalAmount)}', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w600, - color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + '${isIncome ? '+' : ''}${_formatAmount(item.totalAmount)}', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), + ), + ), ), ), ], @@ -978,28 +996,39 @@ class _LedgerDetailPageState extends ConsumerState ), ), // 金额 - Column( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Text( - '${isIncome ? '+' : ''}${_formatAmount(entry.amount)}', - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w700, - color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), - ), - ), - if (entry.balanceAfter != null) ...[ - const SizedBox(height: 4), - Text( - '余额: ${_formatAmount(entry.balanceAfter!)}', - style: const TextStyle( - fontSize: 10, - color: Color(0x995D4037), + ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 120), + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + '${isIncome ? '+' : ''}${_formatAmount(entry.amount)}', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + color: isIncome ? const Color(0xFF4CAF50) : const Color(0xFFE53935), + ), ), ), + if (entry.balanceAfter != null) ...[ + const SizedBox(height: 4), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerRight, + child: Text( + '余额: ${_formatAmount(entry.balanceAfter!)}', + style: const TextStyle( + fontSize: 10, + color: Color(0x995D4037), + ), + ), + ), + ], ], - ], + ), ), ], ), diff --git a/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart b/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart index bdade5ec..2a7fdeae 100644 --- a/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart +++ b/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart @@ -534,13 +534,16 @@ class _TradingPageState extends ConsumerState { valueColor: AlwaysStoppedAnimation(Color(0xFFD4AF37)), ), ) - : Text( - 'DST 余额: ${_formatNumber(_dstBalance)}', - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - height: 1.5, - color: Color(0x995D4037), + : FittedBox( + fit: BoxFit.scaleDown, + child: Text( + 'DST 余额: ${_formatNumber(_dstBalance)}', + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + height: 1.5, + color: Color(0x995D4037), + ), ), ); } @@ -616,13 +619,16 @@ class _TradingPageState extends ConsumerState { valueColor: AlwaysStoppedAnimation(Color(0xFFD4AF37)), ), ) - : Text( - '绿积分 余额: ${_formatNumber(_usdtBalance)}', - style: const TextStyle( - fontSize: 14, - fontFamily: 'Inter', - height: 1.5, - color: Color(0x995D4037), + : FittedBox( + fit: BoxFit.scaleDown, + child: Text( + '绿积分 余额: ${_formatNumber(_usdtBalance)}', + style: const TextStyle( + fontSize: 14, + fontFamily: 'Inter', + height: 1.5, + color: Color(0x995D4037), + ), ), ); } diff --git a/frontend/mobile-app/lib/features/withdraw/presentation/pages/withdraw_usdt_page.dart b/frontend/mobile-app/lib/features/withdraw/presentation/pages/withdraw_usdt_page.dart index 7e32d49a..cb2d6373 100644 --- a/frontend/mobile-app/lib/features/withdraw/presentation/pages/withdraw_usdt_page.dart +++ b/frontend/mobile-app/lib/features/withdraw/presentation/pages/withdraw_usdt_page.dart @@ -568,14 +568,20 @@ class _WithdrawUsdtPageState extends ConsumerState { Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Text( - _formatNumber(_usdtBalance), - style: const TextStyle( - fontSize: 32, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.2, - color: Color(0xFF5D4037), + Flexible( + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + _formatNumber(_usdtBalance), + style: const TextStyle( + fontSize: 32, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.2, + color: Color(0xFF5D4037), + ), + ), ), ), const SizedBox(width: 8),