This commit is contained in:
sion
2026-04-06 16:33:03 +08:00
parent b9234b1121
commit 71c8689989
19 changed files with 231 additions and 6 deletions

View File

@@ -1 +1 @@
{"version":2,"files":[{"path":"D:\\flutter\\bin\\cache\\dart-sdk\\version","hash":"800169ad7335b889bf428af171476466"},{"path":"D:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\.dart_tool\\package_config.json","hash":"d6b4a7aa67aeb750be9e5aec884f1f73"},{"path":"D:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\pubspec.yaml","hash":"03c567345af5a72ca098cfa0a67b3423"},{"path":"D:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\build\\9a5d09bec60a9bd952a3f584c1b9bd3b\\dart_build_result.json","hash":"932fae7a247d7a3fd85340e755adb05b"},{"path":"D:\\flutter\\packages\\flutter_tools\\lib\\src\\build_system\\targets\\native_assets.dart","hash":"f78c405bcece3968277b212042da9ed6"},{"path":"d:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\.dart_tool\\package_config.json","hash":"d6b4a7aa67aeb750be9e5aec884f1f73"}]}
{"version":2,"files":[{"path":"D:\\flutter\\bin\\cache\\dart-sdk\\version","hash":"800169ad7335b889bf428af171476466"},{"path":"D:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\.dart_tool\\package_config.json","hash":"210a143189f8879d1701d1cbd9f101c4"},{"path":"D:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\pubspec.yaml","hash":"e1161312ba8c4e95e1db1322589118d8"},{"path":"D:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\build\\9a5d09bec60a9bd952a3f584c1b9bd3b\\dart_build_result.json","hash":"afae0876d3b33abce85dc7253e57b534"},{"path":"D:\\flutter\\packages\\flutter_tools\\lib\\src\\build_system\\targets\\native_assets.dart","hash":"f78c405bcece3968277b212042da9ed6"},{"path":"d:\\workspace\\project\\com-rattan-spccloud\\flutter_monisuo\\.dart_tool\\package_config.json","hash":"210a143189f8879d1701d1cbd9f101c4"}]}

View File

@@ -1 +1 @@
{"build_start":"2026-04-06T01:07:05.140833","build_end":"2026-04-06T01:07:05.218007","dependencies":["file:///D:/flutter/bin/cache/dart-sdk/version","file:///D:/workspace/project/com-rattan-spccloud/flutter_monisuo/.dart_tool/package_config.json","file:///D:/workspace/project/com-rattan-spccloud/flutter_monisuo/pubspec.yaml","file:///d:/workspace/project/com-rattan-spccloud/flutter_monisuo/.dart_tool/package_config.json"],"code_assets":[],"data_assets":[]}
{"build_start":"2026-04-06T13:57:48.988866","build_end":"2026-04-06T13:57:52.932920","dependencies":["file:///D:/flutter/bin/cache/dart-sdk/version","file:///D:/workspace/project/com-rattan-spccloud/flutter_monisuo/.dart_tool/package_config.json","file:///D:/workspace/project/com-rattan-spccloud/flutter_monisuo/pubspec.yaml","file:///d:/workspace/project/com-rattan-spccloud/flutter_monisuo/.dart_tool/package_config.json"],"code_assets":[],"data_assets":[]}

View File

@@ -108,4 +108,20 @@ class ApiEndpoints {
/// 每日盈亏
static const String dailyProfit = '/api/asset/daily-profit';
// ==================== K线模块 ====================
/// K线历史数据
static const String klineHistory = '/api/kline/history';
/// 当前K线
static const String klineCurrent = '/api/kline/current';
/// 支持的K线周期
static const String klineIntervals = '/api/kline/intervals';
/// K线 WebSocket 地址
static const String klineWs = '${isProduction ? 'ws' : 'ws'}://'
'${isProduction ? '8.155.172.147:5010' : 'localhost:5010'}'
'/ws/kline';
}

View File

@@ -18,9 +18,12 @@ import 'data/services/trade_service.dart';
import 'data/services/asset_service.dart';
import 'data/services/fund_service.dart';
import 'data/services/bonus_service.dart';
import 'data/services/kline_service.dart';
import 'data/services/kline_websocket_service.dart';
import 'providers/auth_provider.dart';
import 'providers/market_provider.dart';
import 'providers/asset_provider.dart';
import 'providers/kline_provider.dart';
import 'providers/theme_provider.dart';
import 'ui/pages/auth/login_page.dart';
import 'ui/pages/main/main_page.dart';
@@ -101,6 +104,8 @@ class MyApp extends StatelessWidget {
Provider<AssetService>(create: (_) => AssetService(dioClient)),
Provider<FundService>(create: (_) => FundService(dioClient)),
Provider<BonusService>(create: (_) => BonusService(dioClient)),
Provider<KlineService>(create: (_) => KlineService(dioClient)),
Provider<KlineWebSocketService>(create: (_) => KlineWebSocketService()),
// State Management
ChangeNotifierProvider<AuthProvider>(
create: (ctx) {
@@ -120,6 +125,12 @@ class MyApp extends StatelessWidget {
ctx.read<AppEventBus>(),
),
),
ChangeNotifierProvider<KlineProvider>(
create: (ctx) => KlineProvider(
ctx.read<KlineService>(),
ctx.read<KlineWebSocketService>(),
),
),
];
}

View File

@@ -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,

View File

@@ -373,6 +373,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.2"
k_chart:
dependency: "direct main"
description:
name: k_chart
sha256: "059163563285cc001dc0257880f598774c63791155a7e0f3a37064dda89c9168"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
leak_tracker:
dependency: transitive
description:
@@ -698,6 +706,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.12.1"
stomp_dart_client:
dependency: "direct main"
description:
name: stomp_dart_client
sha256: "9ca00600a212f1e08fda614cf6815437829b1d08d8911ff5c798f130a2fa2d59"
url: "https://pub.dev"
source: hosted
version: "2.1.3"
stream_channel:
dependency: transitive
description:
@@ -818,6 +834,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.1.1"
web_socket:
dependency: transitive
description:
name: web_socket
sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c"
url: "https://pub.dev"
source: hosted
version: "1.0.1"
web_socket_channel:
dependency: "direct main"
description:
name: web_socket_channel
sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8
url: "https://pub.dev"
source: hosted
version: "3.0.3"
xdg_directories:
dependency: transitive
description:

View File

@@ -40,6 +40,13 @@ dependencies:
# 字体
google_fonts: ^6.2.1
# K线图表
k_chart: ^0.7.1
# WebSocket (STOMP)
stomp_dart_client: ^2.0.0
web_socket_channel: ^3.0.1
dev_dependencies:
flutter_test:
sdk: flutter