KROW for Business — client (manager) app

Flutter app for hospitality managers: book shift coverage (by voice, chat or form), watch it fill live, replace no-shows, approve invoices, and read reports. Runs on demo data today; the API is one class away.

Run it

./setup.sh        # once: generates android/ ios/ web/ with your Flutter + adds mic permissions
flutter run       # demo sign-in code: 123456

Requires Flutter 3.32+ (Dart 3.8+). The only third-party package is speech_to_text.

What's in it

Flow Screens
Getting in Splash, 3-page onboarding, phone number, OTP (wrong-code + lockout), verified, notification & location pre-permission
Today (tab 1) Week strip, live coverage ring, at-risk banners, live shift cards with per-worker status, replace no-show, rate worker, book again, voice card
Book (centre button) Voice order, rapid order chat, one-time / recurring / permanent form, workers step (marketplace vs your teams), review with cost, posted
Orders (tab 2) Up next / Active / Done / Cancelled, order detail, duplicate, cancel
Billing (tab 3) Outstanding, spend chart, approvals queue with batch approve, invoice, timesheet with incidents, dispute
Reports (tab 4) KPIs with good/bad deltas, insights, spend, coverage, attendance, forecast, daily ops
Account Hubs (add with map + radius, archive/restore), workforce tiers, invite team, settings, messages, notifications

Responsive: bottom tabs on phones, side rail from 820 px, wide two-column layouts from ~1000 px.

Voice ordering

Book → Say it, or the voice card on Today. Say something like "We had a call-out — need 2 cooks ASAP" or "3 servers tonight 6 to midnight at Bay View". The app drafts the order, highlights anything it had to assume (in brass), and you confirm before anything is posted.

  • lib/features/voice/voice_service.dart wraps speech_to_text (live words, sound level, permission states).
  • lib/features/voice/order_intent_parser.dart → LocalOrderIntentParser: on-device rules for roles + counts, dates (tonight / tomorrow / Friday / the 15th), times and ranges (ASAP, 6 to midnight, until 5am, for 3 hours), hubs, and order names.
  • Simulators have no mic: tap the example phrases, or type — the same parser runs.
  • To upgrade parsing, implement OrderIntentParser with a call to your backend (e.g. Claude via the FastAPI proxy) and fall back to the local parser.

Wiring the API

The UI only talks to KrowRepository (lib/data/repository.dart):

  1. Implement ApiKrowRepository — each method is already named after its endpoint.
  2. Add fromJson to the models in lib/data/models.dart.
  3. Swap DemoKrowRepository() for ApiKrowRepository(...) in lib/main.dart.

State lives in AppState (lib/state/app_state.dart), exposed with an InheritedNotifier (context.app to watch, context.appRead in callbacks) — no state package.

Layout

lib/
  main.dart, app/            app root, auth gate, tab shell, routes
  core/                      design system: colours, type, theme, responsive, widgets
  data/                      models, demo data, repository (demo + API skeleton)
  state/                     AppState
  features/
    onboarding/ auth/ hubs/ account/
    today/ orders/ book/ voice/ messages/ notifications/
    billing/ reports/ workforce/
assets/                      Poppins (400–700), KROW wordmark

Notes

  • Permission prompts are simulated after the pre-permission sheet (features/auth/permissions.dart); add permission_handler / firebase_messaging there when wiring push.
  • Demo data is generated relative to the current time, so there's always a live shift, an evening event and a no-show to handle.
Description
No description provided
Readme 593 KiB
Languages
Dart 99.2%
Shell 0.4%
HTML 0.2%
Swift 0.2%