111
This commit is contained in:
@@ -4,6 +4,7 @@ import '../../../../core/theme/app_spacing.dart';
|
||||
import '../../../../core/theme/app_theme.dart';
|
||||
import '../../../../core/theme/app_theme_extension.dart';
|
||||
import '../../../../data/models/coin.dart';
|
||||
import '../../kline/kline_page.dart';
|
||||
import 'coin_avatar.dart';
|
||||
|
||||
/// 币种选择器组件
|
||||
@@ -60,6 +61,22 @@ class CoinSelector extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
// K线图标(仅选中币种后显示)
|
||||
if (selectedCoin != null)
|
||||
GestureDetector(
|
||||
onTap: () => _navigateToKline(context),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(AppSpacing.sm),
|
||||
decoration: BoxDecoration(
|
||||
color: context.appColors.surfaceCard,
|
||||
borderRadius: BorderRadius.circular(AppRadius.md),
|
||||
border: Border.all(color: context.appColors.ghostBorder),
|
||||
),
|
||||
child: Icon(LucideIcons.chartNoAxesColumn,
|
||||
size: 20, color: context.colors.primary),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: AppSpacing.sm),
|
||||
// 下拉箭头
|
||||
Icon(LucideIcons.chevronDown,
|
||||
size: 16, color: context.colors.onSurfaceVariant),
|
||||
@@ -69,6 +86,14 @@ class CoinSelector extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
void _navigateToKline(BuildContext context) {
|
||||
if (selectedCoin == null) return;
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (_) => KlinePage(coin: selectedCoin!)),
|
||||
);
|
||||
}
|
||||
|
||||
void _showCoinPicker(BuildContext context) {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
|
||||
Reference in New Issue
Block a user