How sinou3936/stockcontrol works
StockControl is a Flutter inventory app for a multi-store restaurant chain, with Windows and Android clients. A user enters through the app shell, then records or reviews store inventory; the app calculates stock from append-only movement records and persists locally before syncing. The README also documents authentication, store/staff administration, safety-stock alerts, purchase-order exports, and validated Excel imports. The source excerpts are native runner scaffolding, not Dart runtime code, so feature-to-data links below rely on README statements; uncertain implementation details are omitted.
Main entry points: stock_movement_dao.dart Movement records · app_shell.dart App shell · stock_overview_screen.dart Inventory screens · database.dart Local database
Components 26
App experience
- App startup
lib/main.dart - App shell
lib/core/shell/app_shell.dart - Login
lib/features/auth/login_screen.dart
Inventory workflows
- Inventory screens
lib/features/stock_overview/stock_overview_screen.dart - Inbound entry
lib/features/inbound/inbound_form_screen.dart - Stock adjustment
lib/features/stock_adjustment/stock_adjustment_form_screen.dart - Closing count
lib/features/count/count_screen.dart - Stock calculations
lib/domain/stock_overview.dart - Safety-stock alerts
lib/features/shortage/shortage_screen.dart - Purchase orders
lib/features/purchase_order/purchase_order_screen.dart
Data and sync
- Movement records
lib/data/local/daos/stock_movement_dao.dart - Local database
lib/data/local/database.dart - Background sync
lib/data/repositories/sync_repository.dart
Administration and files
- PDF and Excel export
lib/data/export/purchase_order_exporter.dart - Excel import screen
lib/features/excel_import/excel_import_screen.dart - Import validation
lib/data/import/excel_import_service.dart - Store management
lib/features/store_management/store_management_screen.dart - Staff management
lib/features/auth/add_staff_screen.dart
Native hosts
- Windows host
windows/runner/win32_window.cpp - Windows Flutter view
windows/runner/flutter_window.h - Windows window interface
windows/runner/win32_window.h - Linux host interface
linux/runner/my_application.h - Linux plugin registration
linux/flutter/generated_plugin_registrant.h - Windows plugin registration
windows/flutter/generated_plugin_registrant.h
Other components
- Store user
- Supabase
Connections 28
- Store user → App shell: uses
README.md - App startup → App shell: starts
- App shell → Login: routes to
- App shell → Inventory screens: presents
README.md - Store user → Inbound entry: records receipt
README.md - Store user → Stock adjustment: records adjustment
README.md - Store user → Closing count: records count
README.md - Inventory screens → Stock calculations: shows calculated stock
README.md - Stock calculations → Movement records: sums movements
README.md - Inbound entry → Movement records: appends receipt
README.md - Stock adjustment → Movement records: appends adjustment
README.md - Closing count → Movement records: records difference
README.md - Movement records → Local database: persists locally
README.md - Local database → Background sync: queues changes
README.md - Background sync → Supabase: sends and receives
README.md - Inventory screens → Safety-stock alerts: offers alerts
README.md - Safety-stock alerts → Purchase orders: identifies reorder needs
README.md - Purchase orders → PDF and Excel export: creates order files
README.md - Store user → Excel import screen: uploads workbook
README.md - Excel import screen → Import validation: previews and validates
README.md - Import validation → Local database: registers imported data
README.md - Store user → Store management: manages stores
README.md - Store user → Staff management: manages staff
README.md - Windows host → Windows Flutter view: hosts view
- Windows Flutter view → Windows window interface: inherits window
windows/runner/flutter_window.h - Linux host interface → App startup: launches Flutter app
- Windows plugin registration → Windows Flutter view: registers plugins
- Linux plugin registration → Linux host interface: registers plugins