How ndgiang02/xiangqi works
The tree describes a Flutter Xiangqi game with authentication, game modes, engine plugins, and settings. The likely user flow is to choose a mode, play through the game UI, and have moves represented and handled by game logic and data sources. The README is only a Flutter starter template, and the excerpts cover native launchers rather than Dart feature code, so most feature relationships below are dashed and unverified; no app-level calls were directly inspected.
Main entry points: game_repository.dart Game repository · game_repository_impl.dart Repository adapter · game_page.dart Game screen · game_cubit.dart Game state
Components 24
Game experience
- Mode selection
lib/features/game/presentation/page/home/home_page.dart - Game screen
lib/features/game/presentation/page/game_page.dart - Board display
lib/features/game/presentation/widget/board_widget.dart - Bluetooth screens
lib/features/game/presentation/page/bluetooth/bluetooth_game_page.dart - Game state
lib/features/game/presentation/cubit/game_cubit.dart - Bluetooth state
lib/features/game/presentation/cubit/bluetooth_game_cubit.dart
Game domain
- Move handling
lib/features/game/domain/usecases/make_move.dart - Start game
lib/features/game/domain/usecases/start_new_game.dart - Match sync
lib/features/game/domain/usecases/sync_match_state.dart - Game model
lib/features/game/domain/entities/board.dart - Game repository
lib/features/game/domain/repositories/game_repository.dart
Data and services
- Repository adapter
lib/features/game/data/repositories/game_repository_impl.dart - Local game data
lib/features/game/data/datasources/local_game_data_source.dart - Remote game data
lib/features/game/data/datasources/remote_game_data_source.dart - AI engine source
lib/features/game/data/datasources/ai_engie_data_source.dart - Bluetooth service
lib/features/game/data/bluetooth/bluetooth_game_service.dart - Auth API source
lib/features/auth/data/datasources/auth_remote_data_source.dart - Engine interface
plugins/engine_interface/lib/src/engine_interface.dart - Platform engines
plugins/engine_darwin/lib/engine_darwin.dart
App shell
- Login use case
lib/features/auth/domain/usecases/login.dart - Settings
lib/features/setting/presentation/page/setting_page.dart - App routing
lib/routes/app_router.dart - Flutter app
lib/main.dart
Other components
- Player
Connections 23
- Player → Mode selection: chooses mode
- Mode selection → Game screen: opens game
- Game screen → Game state: dispatches actions
- Game screen → Board display: renders board
- Game state → Start game: starts match
- Game state → Move handling: handles move
- Move handling → Game repository: requests update
- Start game → Game repository: requests setup
- Match sync → Game repository: requests sync
- Game repository → Repository adapter: implemented by
- Repository adapter → Local game data: uses local data
- Repository adapter → Remote game data: uses remote data
- Repository adapter → AI engine source: uses engine
- Game model → Game repository: models matches
- Player → Bluetooth screens: joins local play
- Bluetooth screens → Bluetooth state: dispatches actions
- Bluetooth state → Bluetooth service: uses service
- Player → Login use case: requests login
- Login use case → Auth API source: requests authentication
- Player → Settings: changes preferences
- Flutter app → App routing: starts navigation
- AI engine source → Engine interface: uses interface
- Engine interface → Platform engines: implemented by