diff --git a/CLAUDE.md b/CLAUDE.md index dcb77b1..6e323dc 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,12 +5,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Build & Development Commands ```bash -# Run the app (launches on connected device or browser) +# Run the app (launches on connected device) flutter run -# Run specifically for web (primary target) -flutter run -d chrome - # Run analyzer flutter analyze @@ -20,8 +17,12 @@ flutter test # Run a single test file flutter test test/widget_test.dart -# Build for web -flutter build web +# Build release artifacts +flutter build apk --release # Android +flutter build windows --release # Windows +flutter build macos --release # macOS +flutter build linux --release # Linux +flutter build ios --release --no-codesign # iOS(无证书时只验证可编译) # Check for outdated dependencies flutter pub outdated @@ -32,31 +33,55 @@ flutter pub upgrade --major-versions ## Architecture -This is a Flutter app (targeting mobile native) that serves as a QR-code-based login client for the maimai DX arcade game network. +This is a Flutter app (Android / iOS / Windows / macOS / Linux) that serves as a QR-code-based +login client for the maimai DX arcade game network. ### Code Layout ``` lib/ -├── main.dart # App entry point, LoginPage widget (the entire UI) +├── main.dart # 入口:main() + MyApp(MaterialApp) +├── pages/ +│ ├── login_page.dart # 登录页(QR 粘贴 / 图片识别) +│ ├── home_page.dart # 主页骨架(底部导航 + 各 tab) +│ ├── settings_page.dart # Title Server / 机器参数配置 +│ └── ... # 各功能页(ticket / best50 / 风险操作等) +├── widgets/ +│ ├── cooldown_mixin.dart # CooldownMixin:登录后冷却倒计时 +│ ├── step_progress.dart # RiskStep + StepProgressCard +│ ├── app_card.dart # AppCard / SectionTitle / AutoLogoutToggle +│ ├── app_notice.dart # AppNotice + context.showSnack +│ └── best50_poster.dart # B50 成绩图 └── services/ - ├── api_service.dart # API client for game server auth - ├── qr_service.dart # Platform-agnostic QR decode interface (conditional import) - ├── qr_service_native.dart # Native stub — QR decode is NOT implemented on mobile/desktop - └── qr_service_web.dart # Web QR decode via jsQR (loaded in web/index.html via CDN) + ├── api_service.dart # Aime 登录 API 客户端 + ├── title_api_service.dart # 游戏服务器传输层(加解密 / 会话 / 各 Api) + ├── user_all_payload_builder.dart # UpsertUserAll 组装与各补丁 + ├── api_log.dart # 传输层调试日志(仅 debug) + └── ... ``` ### Key Design Decisions -- **Single-widget app**: The entire app is currently one `LoginPage` widget in `main.dart`. There is no routing — the login result shows an `AlertDialog`. -- **Conditional imports for platform code**: `qr_service.dart` uses the `if (dart.library.html)` syntax to import `qr_service_web.dart` on web and `qr_service_native.dart` everywhere else. Native QR scanning returns `null` (not implemented). -- **Web is the primary target**: jsQR is loaded via CDN `