This commit is contained in:
2026-03-23 02:43:35 +08:00
parent a27ee426db
commit a8f9882e54
18 changed files with 1368 additions and 418 deletions

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:shadcn_ui/shadcn_ui.dart';
import 'package:provider/provider.dart';
import '../../../core/constants/app_colors.dart';
import '../../../data/models/coin.dart';
import '../../../providers/market_provider.dart';
@@ -97,7 +98,7 @@ class _MarketPageState extends State<MarketPage> with AutomaticKeepAliveClientMi
return Container(
height: 44,
margin: const EdgeInsets.symmetric(horizontal: 16),
margin: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: Row(
children: tabs.asMap().entries.map((entry) {
final index = entry.key;
@@ -192,7 +193,7 @@ class _MarketPageState extends State<MarketPage> with AutomaticKeepAliveClientMi
onRefresh: provider.refresh,
color: theme.colorScheme.primary,
child: ListView.builder(
padding: const EdgeInsets.symmetric(horizontal: 16),
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
itemCount: coins.length,
itemBuilder: (context, index) => _buildCoinItem(coins[index]),
),
@@ -201,8 +202,6 @@ class _MarketPageState extends State<MarketPage> with AutomaticKeepAliveClientMi
Widget _buildCoinItem(Coin coin) {
final theme = ShadTheme.of(context);
final upColor = const Color(0xFF00C853);
final downColor = const Color(0xFFFF5252);
return Padding(
padding: const EdgeInsets.only(bottom: 8),
@@ -245,13 +244,13 @@ class _MarketPageState extends State<MarketPage> with AutomaticKeepAliveClientMi
Container(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
decoration: BoxDecoration(
color: coin.isUp ? upColor.withValues(alpha: 0.2) : downColor.withValues(alpha: 0.2),
color: AppColors.getChangeBackgroundColor(coin.isUp),
borderRadius: BorderRadius.circular(6),
),
child: Text(
coin.formattedChange,
style: TextStyle(
color: coin.isUp ? upColor : downColor,
color: AppColors.getChangeColor(coin.isUp),
fontWeight: FontWeight.w600,
),
),