From cafffd27e0e8af833589b7f83db5f70793f3e044 Mon Sep 17 00:00:00 2001 From: R-Bharathraj Date: Thu, 17 Sep 2026 22:26:11 +0530 Subject: [PATCH] Initial commit: Krow Worker App --- .gitignore | 46 + .metadata | 36 + README.md | 159 ++++ analysis_options.yaml | 28 + android/.gitignore | 14 + android/app/build.gradle.kts | 45 + android/app/src/debug/AndroidManifest.xml | 7 + android/app/src/main/AndroidManifest.xml | 45 + .../krow/krow_worker_app/MainActivity.kt | 5 + .../res/drawable-v21/launch_background.xml | 12 + .../main/res/drawable/launch_background.xml | 12 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 544 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 442 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 721 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 1031 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 1443 bytes .../app/src/main/res/values-night/styles.xml | 18 + android/app/src/main/res/values/styles.xml | 18 + android/app/src/profile/AndroidManifest.xml | 7 + android/build.gradle.kts | 24 + android/gradle.properties | 6 + .../gradle/wrapper/gradle-wrapper.properties | 5 + android/settings.gradle.kts | 26 + ios/.gitignore | 34 + ios/Flutter/AppFrameworkInfo.plist | 24 + ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Runner.xcodeproj/project.pbxproj | 644 ++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + .../xcshareddata/xcschemes/Runner.xcscheme | 119 +++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/WorkspaceSettings.xcsettings | 8 + ios/Runner/AppDelegate.swift | 16 + .../AppIcon.appiconset/Contents.json | 122 +++ .../Icon-App-1024x1024@1x.png | Bin 0 -> 10932 bytes .../AppIcon.appiconset/Icon-App-20x20@1x.png | Bin 0 -> 295 bytes .../AppIcon.appiconset/Icon-App-20x20@2x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-20x20@3x.png | Bin 0 -> 450 bytes .../AppIcon.appiconset/Icon-App-29x29@1x.png | Bin 0 -> 282 bytes .../AppIcon.appiconset/Icon-App-29x29@2x.png | Bin 0 -> 462 bytes .../AppIcon.appiconset/Icon-App-29x29@3x.png | Bin 0 -> 704 bytes .../AppIcon.appiconset/Icon-App-40x40@1x.png | Bin 0 -> 406 bytes .../AppIcon.appiconset/Icon-App-40x40@2x.png | Bin 0 -> 586 bytes .../AppIcon.appiconset/Icon-App-40x40@3x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@2x.png | Bin 0 -> 862 bytes .../AppIcon.appiconset/Icon-App-60x60@3x.png | Bin 0 -> 1674 bytes .../AppIcon.appiconset/Icon-App-76x76@1x.png | Bin 0 -> 762 bytes .../AppIcon.appiconset/Icon-App-76x76@2x.png | Bin 0 -> 1226 bytes .../Icon-App-83.5x83.5@2x.png | Bin 0 -> 1418 bytes .../LaunchImage.imageset/Contents.json | 23 + .../LaunchImage.imageset/LaunchImage.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@2x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/LaunchImage@3x.png | Bin 0 -> 68 bytes .../LaunchImage.imageset/README.md | 5 + ios/Runner/Base.lproj/LaunchScreen.storyboard | 37 + ios/Runner/Base.lproj/Main.storyboard | 26 + ios/Runner/Info.plist | 70 ++ ios/Runner/Runner-Bridging-Header.h | 1 + ios/Runner/SceneDelegate.swift | 6 + ios/RunnerTests/RunnerTests.swift | 12 + lib/core/formatters.dart | 51 ++ lib/core/router.dart | 137 +++ lib/core/theme.dart | 144 +++ lib/core/transitions.dart | 84 ++ lib/main.dart | 73 ++ lib/models/availability.dart | 21 + lib/models/compliance.dart | 82 ++ lib/models/shift.dart | 95 ++ lib/models/timecard.dart | 70 ++ lib/models/worker.dart | 57 ++ lib/screens/auth_screens.dart | 650 ++++++++++++++ lib/screens/availability_screen.dart | 337 +++++++ lib/screens/clock_screen.dart | 397 +++++++++ lib/screens/compliance_screens.dart | 565 ++++++++++++ lib/screens/home_shell.dart | 107 +++ lib/screens/onboarding_screens.dart | 448 ++++++++++ lib/screens/pay_screens.dart | 620 +++++++++++++ lib/screens/profile_detail_screens.dart | 736 +++++++++++++++ lib/screens/profile_screen.dart | 362 ++++++++ lib/screens/settings_screens.dart | 589 ++++++++++++ lib/screens/shift_detail_screen.dart | 379 ++++++++ lib/screens/shifts_screen.dart | 396 +++++++++ lib/screens/timecard_screens.dart | 388 ++++++++ lib/screens/today_screen.dart | 421 +++++++++ lib/state/availability_controller.dart | 128 +++ lib/state/compliance_controller.dart | 178 ++++ lib/state/profile_controller.dart | 168 ++++ lib/state/seed.dart | 392 ++++++++ lib/state/session_controller.dart | 115 +++ lib/state/shifts_controller.dart | 172 ++++ lib/state/timecards_controller.dart | 49 + lib/widgets/collapsing_header.dart | 137 +++ lib/widgets/common.dart | 835 ++++++++++++++++++ lib/widgets/glass_segments.dart | 191 ++++ lib/widgets/krow_nav_bar.dart | 215 +++++ lib/widgets/shift_card.dart | 170 ++++ lib/widgets/week_strip.dart | 143 +++ pubspec.lock | 578 ++++++++++++ pubspec.yaml | 95 ++ test/screen_layout_test.dart | 100 +++ test/shift_logic_test.dart | 128 +++ test/transitions_test.dart | 88 ++ test/widgets_test.dart | 195 ++++ web/favicon.png | Bin 0 -> 917 bytes web/icons/Icon-192.png | Bin 0 -> 5292 bytes web/icons/Icon-512.png | Bin 0 -> 8252 bytes web/icons/Icon-maskable-192.png | Bin 0 -> 5594 bytes web/icons/Icon-maskable-512.png | Bin 0 -> 20998 bytes web/index.html | 46 + web/manifest.json | 35 + 113 files changed, 13067 insertions(+) create mode 100644 .gitignore create mode 100644 .metadata create mode 100644 README.md create mode 100644 analysis_options.yaml create mode 100644 android/.gitignore create mode 100644 android/app/build.gradle.kts create mode 100644 android/app/src/debug/AndroidManifest.xml create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/kotlin/in/nearle/krow/krow_worker_app/MainActivity.kt create mode 100644 android/app/src/main/res/drawable-v21/launch_background.xml create mode 100644 android/app/src/main/res/drawable/launch_background.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/values-night/styles.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/app/src/profile/AndroidManifest.xml create mode 100644 android/build.gradle.kts create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100644 android/settings.gradle.kts create mode 100644 ios/.gitignore create mode 100644 ios/Flutter/AppFrameworkInfo.plist create mode 100644 ios/Flutter/Debug.xcconfig create mode 100644 ios/Flutter/Release.xcconfig create mode 100644 ios/Runner.xcodeproj/project.pbxproj create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme create mode 100644 ios/Runner.xcworkspace/contents.xcworkspacedata create mode 100644 ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings create mode 100644 ios/Runner/AppDelegate.swift create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png create mode 100644 ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png create mode 100644 ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md create mode 100644 ios/Runner/Base.lproj/LaunchScreen.storyboard create mode 100644 ios/Runner/Base.lproj/Main.storyboard create mode 100644 ios/Runner/Info.plist create mode 100644 ios/Runner/Runner-Bridging-Header.h create mode 100644 ios/Runner/SceneDelegate.swift create mode 100644 ios/RunnerTests/RunnerTests.swift create mode 100644 lib/core/formatters.dart create mode 100644 lib/core/router.dart create mode 100644 lib/core/theme.dart create mode 100644 lib/core/transitions.dart create mode 100644 lib/main.dart create mode 100644 lib/models/availability.dart create mode 100644 lib/models/compliance.dart create mode 100644 lib/models/shift.dart create mode 100644 lib/models/timecard.dart create mode 100644 lib/models/worker.dart create mode 100644 lib/screens/auth_screens.dart create mode 100644 lib/screens/availability_screen.dart create mode 100644 lib/screens/clock_screen.dart create mode 100644 lib/screens/compliance_screens.dart create mode 100644 lib/screens/home_shell.dart create mode 100644 lib/screens/onboarding_screens.dart create mode 100644 lib/screens/pay_screens.dart create mode 100644 lib/screens/profile_detail_screens.dart create mode 100644 lib/screens/profile_screen.dart create mode 100644 lib/screens/settings_screens.dart create mode 100644 lib/screens/shift_detail_screen.dart create mode 100644 lib/screens/shifts_screen.dart create mode 100644 lib/screens/timecard_screens.dart create mode 100644 lib/screens/today_screen.dart create mode 100644 lib/state/availability_controller.dart create mode 100644 lib/state/compliance_controller.dart create mode 100644 lib/state/profile_controller.dart create mode 100644 lib/state/seed.dart create mode 100644 lib/state/session_controller.dart create mode 100644 lib/state/shifts_controller.dart create mode 100644 lib/state/timecards_controller.dart create mode 100644 lib/widgets/collapsing_header.dart create mode 100644 lib/widgets/common.dart create mode 100644 lib/widgets/glass_segments.dart create mode 100644 lib/widgets/krow_nav_bar.dart create mode 100644 lib/widgets/shift_card.dart create mode 100644 lib/widgets/week_strip.dart create mode 100644 pubspec.lock create mode 100644 pubspec.yaml create mode 100644 test/screen_layout_test.dart create mode 100644 test/shift_logic_test.dart create mode 100644 test/transitions_test.dart create mode 100644 test/widgets_test.dart create mode 100644 web/favicon.png create mode 100644 web/icons/Icon-192.png create mode 100644 web/icons/Icon-512.png create mode 100644 web/icons/Icon-maskable-192.png create mode 100644 web/icons/Icon-maskable-512.png create mode 100644 web/index.html create mode 100644 web/manifest.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e9ba21 --- /dev/null +++ b/.gitignore @@ -0,0 +1,46 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.build/ +.buildlog/ +.history +.svn/ +.swiftpm/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ +.claude/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins-dependencies +.pub-cache/ +.pub/ +/build/ +/coverage/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/.metadata b/.metadata new file mode 100644 index 0000000..4eaf696 --- /dev/null +++ b/.metadata @@ -0,0 +1,36 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "6b182d2c7585eba26d4edce0f97630effd256c33" + channel: "stable" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + base_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + - platform: android + create_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + base_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + - platform: ios + create_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + base_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + - platform: web + create_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + base_revision: 6b182d2c7585eba26d4edce0f97630effd256c33 + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/README.md b/README.md new file mode 100644 index 0000000..d6d5ae2 --- /dev/null +++ b/README.md @@ -0,0 +1,159 @@ +# KROW Worker + +A Flutter app for shift workers: find hospitality shifts, clock in on site, get +timecards filed automatically, and keep compliance documents in order. + +Built from the workflow in the KROW worker-app prototype — the HTML was used as +the reference for screens and flow, not as a pixel spec. + +## Running it + +```bash +flutter pub get +flutter run +``` + +Targets Android, iOS and web. To try it in a browser: + +```bash +flutter run -d chrome +``` + +**Demo sign-in:** any 10-digit mobile number, then the code `123456`. + +## What works + +Everything below is wired to real state, not static screens. Shifts, timecards +and compliance live in memory for the session; onboarding, sign-in, +availability, skills and preferences persist via `shared_preferences`. + +**Getting in** — splash routes by how far you got last time · 3-screen +onboarding with skip · phone entry with validation · OTP with a resend +countdown, a wrong-code path and a 3-try budget · 3-step permission run whose +grants are recorded and reflected in Settings. + +**Today** — greeting, period earnings and hours logged, a compliance nudge while +anything is outstanding, your next shift, quick tiles and matched open shifts. + +**Shifts** — Booked / Open / History. The week strip filters booked shifts by +day and dots the days that have work. Open supports search and filters, and +Apply books the shift immediately. History carries completed, cancelled and +no-show shifts with a stat rail. + +**Shift detail** — full schedule and pay breakdown, plus a requirements check +that compares what the business asks for against what you actually have on +file. Actions change with status: apply, cancel (with confirmation), or jump to +the clock. + +**Clock** — the button unlocks 30 minutes before the shift, and only once you +are at the venue. Clocking in starts a live stopwatch against a progress ring; +clocking out completes the shift, deducts the unpaid break and files a timecard. + +**Timecards** — every filed card with its scheduled vs clocked window, variance +in minutes, and pay. Review one to approve it or raise a dispute with a note. +The tab badge counts what is still waiting on you. + +**Pay** — gross pre-tax earnings across week / month / year / all, a trend chart +split paid vs pending, per-payment detail, and a semi-monthly payroll schedule +that computes the current and next period from today's date. + +**Profile & compliance** — live stats and a trust index derived from the shifts +you have actually worked. The compliance hub tracks documents, certificates, tax +forms and attire; uploading sends an item back for review, removing it drops it +to missing, and expiry dates are picked from a calendar. Plus emergency +contacts, experience and skills, availability, benefits, direct deposit, +settings, support, FAQs and privacy. + +## Motion + +Motion is used to explain what changed, not to decorate. The rules: + +- **Going deeper pushes.** Detail screens slide in from the right while the + screen behind eases back and dims, so the stack reads as a stack. Going + sideways — sign-up steps, replacing a screen — cross-fades instead. +- **Selection travels.** The bottom nav indicator and the segmented controls + slide between positions and squash slightly at speed. Labels light up as the + indicator arrives over them, driven by the same animated value, so nothing + changes ahead of the thing causing it. +- **Numbers grow.** Progress bars and chart bars tween to new values, so an + uploaded document or a switched pay range is something you watch happen. +- **State changes animate together.** Availability blocks, week-strip days and + the clock dial move every part of themselves in one gesture rather than + flipping several properties at once. +- **Consequential actions are felt.** Clocking in and out give a medium impact; + selecting a tab, segment, or applying for a shift gives a selection click. + +**Headers stay put.** On the five tabs the blue header is pinned: content +scrolls beneath it rather than pushing it off the top. A tall header held at +full size would cost a quarter of a phone screen for the whole session, so it +collapses as you scroll and cross-fades to a compact bar that keeps what still +matters — your name and the period figure on Today, the gross total on Pay. + +Where a header holds a control, the collapsed state keeps it. Pay stops +shrinking while the range switcher is still on screen; collapsing that away +would mean scrolling back to the top just to change what you are looking at. +Shifts keeps its whole header fixed for the same reason — the Booked / Open / +History switch has to stay reachable. + +Scrolling uses bouncing physics on every platform (`KrowScrollBehavior`). Under +a pinned header a rubber-band edge tells you that you have reached the end of +the content rather than the end of the screen; clamping just stops dead. The +overscroll glow is turned off, since the bounce already says it. + +Two deliberate exceptions: + +- **Tab content does not slide.** Switching bottom tabs fades and lifts the + content instead. An `AnimatedSwitcher` would hold two copies of the shell in + the tree, and the branch navigators are keyed by `GlobalKey`, so duplicating + them throws. `_TabTransition` animates one subtree in place, which keeps each + tab's scroll position. +- **No `Hero` between list and detail.** The tab branches all stay alive in an + `IndexedStack`, so the same shift can be on screen in two branches at once + and duplicate hero tags would throw. + +## Layout + +``` +lib/ + core/ theme, router, formatters + models/ shift, timecard, availability, compliance, worker + state/ Riverpod controllers + seed data + screens/ one file per area of the app + widgets/ shift card, week strip, shared pieces +``` + +## Packages + +| Package | Why | +| --- | --- | +| `flutter_riverpod` | State: shifts, timecards, availability, compliance, profile, session | +| `go_router` | Routing, including the 5-tab shell where each tab keeps its own stack | +| `google_fonts` | Poppins, the brand typeface | +| `lucide_icons_flutter` | Icon set matching the prototype's line icons | +| `intl` | Currency, date and time formatting | +| `shared_preferences` | Persisting session, availability and preferences | + +## Tests + +```bash +flutter test +``` + +Covers pay calculation (break deduction, clocked vs scheduled hours, zero-pay +states), timecard variance, and the formatters — plus the custom nav and +segmented control: that the indicator actually travels rather than jumping, +that taps report the right index, and that each tab reaches the semantics tree +with its selected state (the dot alone is not readable). + +## Wiring it to a backend + +The seams are deliberate. `lib/state/seed.dart` is the only source of demo data; +swap each controller's `build()` for an API call and the screens are unchanged. +Two places currently stand in for device APIs: + +- **Geofence** — `ClockScreen` has an "at the venue" switch in place of GPS. + Replace with `geolocator` and a 150 m radius check against the venue. +- **File upload** — the compliance sheet fakes a filename. Replace with + `image_picker` / `file_picker` and a real upload. + +Notifications and SMS verification are also stubbed: the OTP is always `123456`. diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 0000000..0d29021 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,28 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:flutter_lints/flutter.yaml + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # avoid_print: false # Uncomment to disable the `avoid_print` rule + # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/android/.gitignore b/android/.gitignore new file mode 100644 index 0000000..be3943c --- /dev/null +++ b/android/.gitignore @@ -0,0 +1,14 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java +.cxx/ + +# Remember to never publicly share your keystore. +# See https://flutter.dev/to/reference-keystore +key.properties +**/*.keystore +**/*.jks diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts new file mode 100644 index 0000000..01af1bb --- /dev/null +++ b/android/app/build.gradle.kts @@ -0,0 +1,45 @@ +plugins { + id("com.android.application") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "in.nearle.krow.krow_worker_app" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "in.nearle.krow.krow_worker_app" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..924d2ba --- /dev/null +++ b/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/kotlin/in/nearle/krow/krow_worker_app/MainActivity.kt b/android/app/src/main/kotlin/in/nearle/krow/krow_worker_app/MainActivity.kt new file mode 100644 index 0000000..ceffe6b --- /dev/null +++ b/android/app/src/main/kotlin/in/nearle/krow/krow_worker_app/MainActivity.kt @@ -0,0 +1,5 @@ +package `in`.nearle.krow.krow_worker_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/android/app/src/main/res/drawable-v21/launch_background.xml b/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 0000000..f74085f --- /dev/null +++ b/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 0000000..304732f --- /dev/null +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..db77bb4b7b0906d62b1847e87f15cdcacf6a4f29 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^9w5xY3?!3`olAj~WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!h8bpbvhu0Wd6uZuB!w&u2PAxD2eNXD>P5D~Wn-+_Wa#27Xc zC?Zj|6r#X(-D3u$NCt}(Ms06KgJ4FxJVv{GM)!I~&n8Bnc94O7-Hd)cjDZswgC;Qs zO=b+9!WcT8F?0rF7!Uys2bs@gozCP?z~o%U|N3vA*22NaGQG zlg@K`O_XuxvZ&Ks^m&R!`&1=spLvfx7oGDKDwpwW`#iqdw@AL`7MR}m`rwr|mZgU`8P7SBkL78fFf!WnuYWm$5Z0 zNXhDbCv&49sM544K|?c)WrFfiZvCi9h0O)B3Pgg&ebxsLQ05GG~ AQ2+n{ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..17987b79bb8a35cc66c3c1fd44f5a5526c1b78be GIT binary patch literal 442 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sk|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5Xx&nMcT!A!W`0S9QKQy;}1Cl^CgaH=;G9cpY;r$Q>i*pfB zP2drbID<_#qf;rPZx^FqH)F_D#*k@@q03KywUtLX8Ua?`H+NMzkczFPK3lFz@i_kW%1NOn0|D2I9n9wzH8m|-tHjsw|9>@K=iMBhxvkv6m8Y-l zytQ?X=U+MF$@3 zt`~i=@j|6y)RWMK--}M|=T`o&^Ni>IoWKHEbBXz7?A@mgWoL>!*SXo`SZH-*HSdS+ yn*9;$7;m`l>wYBC5bq;=U}IMqLzqbYCidGC!)_gkIk_C@Uy!y&wkt5C($~2D>~)O*cj@FGjOCM)M>_ixfudOh)?xMu#Fs z#}Y=@YDTwOM)x{K_j*Q;dPdJ?Mz0n|pLRx{4n|)f>SXlmV)XB04CrSJn#dS5nK2lM zrZ9#~WelCp7&e13Y$jvaEXHskn$2V!!DN-nWS__6T*l;H&Fopn?A6HZ-6WRLFP=R` zqG+CE#d4|IbyAI+rJJ`&x9*T`+a=p|0O(+s{UBcyZdkhj=yS1>AirP+0R;mf2uMgM zC}@~JfByORAh4SyRgi&!(cja>F(l*O+nd+@4m$|6K6KDn_&uvCpV23&>G9HJp{xgg zoq1^2_p9@|WEo z*X_Uko@K)qYYv~>43eQGMdbiGbo>E~Q& zrYBH{QP^@Sti!`2)uG{irBBq@y*$B zi#&(U-*=fp74j)RyIw49+0MRPMRU)+a2r*PJ$L5roHt2$UjExCTZSbq%V!HeS7J$N zdG@vOZB4v_lF7Plrx+hxo7(fCV&}fHq)$ literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..d5f1c8d34e7a88e3f88bea192c3a370d44689c3c GIT binary patch literal 1031 zcmeAS@N?(olHy`uVBq!ia0vp^6F``Q8Ax83A=Cw=BuiW)N`mv#O3D+9QW+dm@{>{( zJaZG%Q-e|yQz{EjrrIztFa`(sgt!6~Yi|1%a`XoT0ojZ}lNrNjb9xjc(B0U1_% zz5^97Xt*%oq$rQy4?0GKNfJ44uvxI)gC`h-NZ|&0-7(qS@?b!5r36oQ}zyZrNO3 zMO=Or+<~>+A&uN&E!^Sl+>xE!QC-|oJv`ApDhqC^EWD|@=#J`=d#Xzxs4ah}w&Jnc z$|q_opQ^2TrnVZ0o~wh<3t%W&flvYGe#$xqda2bR_R zvPYgMcHgjZ5nSA^lJr%;<&0do;O^tDDh~=pIxA#coaCY>&N%M2^tq^U%3DB@ynvKo}b?yu-bFc-u0JHzced$sg7S3zqI(2 z#Km{dPr7I=pQ5>FuK#)QwK?Y`E`B?nP+}U)I#c1+FM*1kNvWG|a(TpksZQ3B@sD~b zpQ2)*V*TdwjFOtHvV|;OsiDqHi=6%)o4b!)x$)%9pGTsE z-JL={-Ffv+T87W(Xpooq<`r*VzWQcgBN$$`u}f>-ZQI1BB8ykN*=e4rIsJx9>z}*o zo~|9I;xof literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000000000000000000000000000000000000..4d6372eebdb28e45604e46eeda8dd24651419bc0 GIT binary patch literal 1443 zcmb`G{WsKk6vsdJTdFg%tJav9_E4vzrOaqkWF|A724Nly!y+?N9`YV6wZ}5(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`jgbqq)P22H)Tx2CpmM^o1$B+xT6`(v%5xJ(?j#>Q$+rx_R|7TzDZe{J6q zG1*EcU%tE?!kO%^M;3aM6JN*LAKUVb^xz8-Pxo#jR5(-KBeLJvA@-gxNHx0M-ZJLl z;#JwQoh~9V?`UVo#}{6ka@II>++D@%KqGpMdlQ}?9E*wFcf5(#XQnP$Dk5~%iX^>f z%$y;?M0BLp{O3a(-4A?ewryHrrD%cx#Q^%KY1H zNre$ve+vceSLZcNY4U(RBX&)oZn*Py()h)XkE?PL$!bNb{N5FVI2Y%LKEm%yvpyTP z(1P?z~7YxD~Rf<(a@_y` literal 0 HcmV?d00001 diff --git a/android/app/src/main/res/values-night/styles.xml b/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 0000000..06952be --- /dev/null +++ b/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/main/res/values/styles.xml b/android/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..cb1ef88 --- /dev/null +++ b/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 0000000..399f698 --- /dev/null +++ b/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/android/build.gradle.kts b/android/build.gradle.kts new file mode 100644 index 0000000..dbee657 --- /dev/null +++ b/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/android/gradle.properties b/android/gradle.properties new file mode 100644 index 0000000..e96108c --- /dev/null +++ b/android/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..2d428bf --- /dev/null +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts new file mode 100644 index 0000000..c21f0c5 --- /dev/null +++ b/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false +} + +include(":app") diff --git a/ios/.gitignore b/ios/.gitignore new file mode 100644 index 0000000..7a7f987 --- /dev/null +++ b/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 0000000..391a902 --- /dev/null +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + + diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig new file mode 100644 index 0000000..592ceee --- /dev/null +++ b/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 0000000..28fa846 --- /dev/null +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,644 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 7884E8672EC3CC0400C636F2 /* SceneDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + 7884E8682EC3CC0700C636F2 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = in.nearle.krow.krowWorkerApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = in.nearle.krow.krowWorkerApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = in.nearle.krow.krowWorkerApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = in.nearle.krow.krowWorkerApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = in.nearle.krow.krowWorkerApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = in.nearle.krow.krowWorkerApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 0000000..c3fedb2 --- /dev/null +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcworkspace/contents.xcworkspacedata b/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..1d526a1 --- /dev/null +++ b/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..f9b0d7c --- /dev/null +++ b/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift new file mode 100644 index 0000000..c30b367 --- /dev/null +++ b/ios/Runner/AppDelegate.swift @@ -0,0 +1,16 @@ +import Flutter +import UIKit + +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d36b1fa --- /dev/null +++ b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..dc9ada4725e9b0ddb1deab583e5b5102493aa332 GIT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cmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..797d452e458972bab9d994556c8305db4c827017 GIT binary patch literal 406 zcmV;H0crk;P))>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..6ed2d933e1120817fe9182483a228007b18ab6ae GIT binary patch literal 450 zcmV;z0X_bSP)iGWQ_5NJQ_~rNh*z)}eT%KUb z`7gNk0#AwF^#0T0?hIa^`~Ck;!}#m+_uT050aTR(J!bU#|IzRL%^UsMS#KsYnTF*!YeDOytlP4VhV?b} z%rz_<=#CPc)tU1MZTq~*2=8~iZ!lSa<{9b@2Jl;?IEV8)=fG217*|@)CCYgFze-x? zIFODUIA>nWKpE+bn~n7;-89sa>#DR>TSlqWk*!2hSN6D~Qb#VqbP~4Fk&m`@1$JGr zXPIdeRE&b2Thd#{MtDK$px*d3-Wx``>!oimf%|A-&-q*6KAH)e$3|6JV%HX{Hig)k suLT-RhftRq8b9;(V=235Wa|I=027H2wCDra;{X5v07*qoM6N<$f;9x^2LJ#7 literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..4cd7b0099ca80c806f8fe495613e8d6c69460d76 GIT binary patch literal 282 zcmV+#0p(^bcu7P-R4C8Q z&e;xxFbF_Vrezo%_kH*OKhshZ6BFpG-Y1e10`QXJKbND7AMQ&cMj60B5TNObaZxYybcN07*qoM6N<$g3m;S%K!iX literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..fe730945a01f64a61e2235dbe3f45b08f7729182 GIT binary patch literal 462 zcmV;<0WtoGP)-}iV`2<;=$?g5M=KQbZ{F&YRNy7Nn@%_*5{gvDM0aKI4?ESmw z{NnZg)A0R`+4?NF_RZexyVB&^^ZvN!{I28tr{Vje;QNTz`dG&Jz0~Ek&f2;*Z7>B|cg}xYpxEFY+0YrKLF;^Q+-HreN0P{&i zK~zY`?b7ECf-n?@;d<&orQ*Q7KoR%4|C>{W^h6@&01>0SKS`dn{Q}GT%Qj_{PLZ_& zs`MFI#j-(>?bvdZ!8^xTwlY{qA)T4QLbY@j(!YJ7aXJervHy6HaG_2SB`6CC{He}f zHVw(fJWApwPq!6VY7r1w-Fs)@ox~N+q|w~e;JI~C4Vf^@d>Wvj=fl`^u9x9wd9 zR%3*Q+)t%S!MU_`id^@&Y{y7-r98lZX0?YrHlfmwb?#}^1b{8g&KzmkE(L>Z&)179 zp<)v6Y}pRl100G2FL_t(o!|l{-Q-VMg#&MKg7c{O0 z2wJImOS3Gy*Z2Qifdv~JYOp;v+U)a|nLoc7hNH;I$;lzDt$}rkaFw1mYK5_0Q(Sut zvbEloxON7$+HSOgC9Z8ltuC&0OSF!-mXv5caV>#bc3@hBPX@I$58-z}(ZZE!t-aOG zpjNkbau@>yEzH(5Yj4kZiMH32XI!4~gVXNnjAvRx;Sdg^`>2DpUEwoMhTs_st8pKG z(%SHyHdU&v%f36~uERh!bd`!T2dw;z6PrOTQ7Vt*#9F2uHlUVnb#ev_o^fh}Dzmq} zWtlk35}k=?xj28uO|5>>$yXadTUE@@IPpgH`gJ~Ro4>jd1IF|(+IX>8M4Ps{PNvmI zNj4D+XgN83gPt_Gm}`Ybv{;+&yu-C(Grdiahmo~BjG-l&mWM+{e5M1sm&=xduwgM9 z`8OEh`=F3r`^E{n_;%9weN{cf2%7=VzC@cYj+lg>+3|D|_1C@{hcU(DyQG_BvBWe? zvTv``=%b1zrol#=R`JB)>cdjpWt&rLJgVp-t?DREyuq1A%0Z4)6_WsQ7{nzjN zo!X zGXV)2i3kcZIL~_j>uIKPK_zib+3T+Nt3Mb&Br)s)UIaA}@p{wDda>7=Q|mGRp7pqY zkJ!7E{MNz$9nOwoVqpFb)}$IP24Wn2JJ=Cw(!`OXJBr45rP>>AQr$6c7slJWvbpNW z@KTwna6d?PP>hvXCcp=4F;=GR@R4E7{4VU^0p4F>v^#A|>07*qoM6N<$f*5nx ACIA2c literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..502f463a9bc882b461c96aadf492d1729e49e725 GIT binary patch literal 586 zcmV-Q0=4~#P)+}#`wDE{8-2Mebf5<{{PqV{TgVcv*r8?UZ3{-|G?_}T*&y;@cqf{ z{Q*~+qr%%p!1pS*_Uicl#q9lc(D`!D`LN62sNwq{oYw(Wmhk)k<@f$!$@ng~_5)Ru z0Z)trIA5^j{DIW^c+vT2%lW+2<(RtE2wR;4O@)Tm`Xr*?A(qYoM}7i5Yxw>D(&6ou zxz!_Xr~yNF+waPe00049Nkl*;a!v6h%{rlvIH#gW3s8p;bFr=l}mRqpW2h zw=OA%hdyL~z+UHOzl0eKhEr$YYOL-c-%Y<)=j?(bzDweB7{b+%_ypvm_cG{SvM=DK zhv{K@m>#Bw>2W$eUI#iU)Wdgs8Y3U+A$Gd&{+j)d)BmGKx+43U_!tik_YlN)>$7G! zhkE!s;%oku3;IwG3U^2kw?z+HM)jB{@zFhK8P#KMSytSthr+4!c(5c%+^UBn`0X*2 zy3(k600_CSZj?O$Qu%&$;|TGUJrptR(HzyIx>5E(2r{eA(<6t3e3I0B)7d6s7?Z5J zZ!rtKvA{MiEBm&KFtoifx>5P^Z=vl)95XJn()aS5%ad(s?4-=Tkis9IGu{`Fy8r+H07*qoM6N<$f20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0ec303439225b78712f49115768196d8d76f6790 GIT binary patch literal 862 zcmV-k1EKthP)20Z)wqMt%V?S?~D#06};F zA3KcL`Wb+>5ObvgQIG&ig8(;V04hz?@cqy3{mSh8o!|U|)cI!1_+!fWH@o*8vh^CU z^ws0;(c$gI+2~q^tO#GDHf@=;DncUw00J^eL_t(&-tE|HQ`%4vfZ;WsBqu-$0nu1R zq^Vj;p$clf^?twn|KHO+IGt^q#a3X?w9dXC@*yxhv&l}F322(8Y1&=P&I}~G@#h6; z1CV9ecD9ZEe87{{NtI*)_aJ<`kJa z?5=RBtFF50s;jQLFil-`)m2wrb=6h(&brpj%nG_U&ut~$?8Rokzxi8zJoWr#2dto5 zOX_URcc<1`Iky+jc;A%Vzx}1QU{2$|cKPom2Vf1{8m`vja4{F>HS?^Nc^rp}xo+Nh zxd}eOm`fm3@MQC1< zIk&aCjb~Yh%5+Yq0`)D;q{#-Uqlv*o+Oor zE!I71Z@ASH3grl8&P^L0WpavHoP|UX4e?!igT`4?AZk$hu*@%6WJ;zDOGlw7kj@ zY5!B-0ft0f?Lgb>C;$Ke07*qoM6N<$f~t1N9smFU literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..e9f5fea27c705180eb716271f41b582e76dcbd90 GIT binary patch literal 1674 zcmV;526g#~P){YQnis^a@{&-nmRmq)<&%Mztj67_#M}W?l>kYSliK<%xAp;0j{!}J0!o7b zE>q9${Lb$D&h7k=+4=!ek^n+`0zq>LL1O?lVyea53S5x`Nqqo2YyeuIrQrJj9XjOp z{;T5qbj3}&1vg1VK~#9!?b~^C5-}JC@Pyrv-6dSEqJqT}#j9#dJ@GzT@B8}x zU&J@bBI>f6w6en+CeI)3^kC*U?}X%OD8$Fd$H&LV$H&LV$H&LV#|K5~mLYf|VqzOc zkc7qL~0sOYuM{tG`rYEDV{DWY`Z8&)kW*hc2VkBuY+^Yx&92j&StN}Wp=LD zxoGxXw6f&8sB^u})h@b@z0RBeD`K7RMR9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qlG#&J7 zAkD(jpw|oZLNiA>;>hgp1KX7-wxC~31II47gc zHcehD6Uxlf%+M^^uN5Wc*G%^;>D5qT{>=uxUhX%WJu^Z*(_Wq9y}npFO{Hhb>s6<9 zNi0pHXWFaVZnb)1+RS&F)xOv6&aeILcI)`k#0YE+?e)5&#r7J#c`3Z7x!LpTc01dx zrdC3{Z;joZ^KN&))zB_i)I9fWedoN>Zl-6_Iz+^G&*ak2jpF07*qoM6N<$f;w%0(f|Me literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0467bf12aa4d28f374bb26596605a46dcbb3e7c8 GIT binary patch literal 1418 zcmV;51$Fv~P)q zKfU)WzW*n(@|xWGCA9ScMt*e9`2kdxPQ&&>|-UCa7_51w+ zLUsW@ZzZSW0y$)Hp~e9%PvP|a03ks1`~K?q{u;6NC8*{AOqIUq{CL&;p56Lf$oQGq z^={4hPQv)y=I|4n+?>7Fim=dxt1 z2H+Dm+1+fh+IF>G0SjJMkQQre1x4|G*Z==(Ot&kCnUrL4I(rf(ucITwmuHf^hXiJT zkdTm&kdTm&kdTm&kdP`esgWG0BcWCVkVZ&2dUwN`cgM8QJb`Z7Z~e<&Yj2(}>Tmf` zm1{eLgw!b{bXkjWbF%dTkTZEJWyWOb##Lfw4EK2}<0d6%>AGS{po>WCOy&f$Tay_> z?NBlkpo@s-O;0V%Y_Xa-G#_O08q5LR*~F%&)}{}r&L%Sbs8AS4t7Y0NEx*{soY=0MZExqA5XHQkqi#4gW3 zqODM^iyZl;dvf)-bOXtOru(s)Uc7~BFx{w-FK;2{`VA?(g&@3z&bfLFyctOH!cVsF z7IL=fo-qBndRUm;kAdXR4e6>k-z|21AaN%ubeVrHl*<|s&Ax@W-t?LR(P-24A5=>a z*R9#QvjzF8n%@1Nw@?CG@6(%>+-0ASK~jEmCV|&a*7-GKT72W<(TbSjf)&Eme6nGE z>Gkj4Sq&2e+-G%|+NM8OOm5zVl9{Z8Dd8A5z3y8mZ=4Bv4%>as_{9cN#bm~;h>62( zdqY93Zy}v&c4n($Vv!UybR8ocs7#zbfX1IY-*w~)p}XyZ-SFC~4w>BvMVr`dFbelV{lLL0bx7@*ZZdebr3`sP;? zVImji)kG)(6Juv0lz@q`F!k1FE;CQ(D0iG$wchPbKZQELlsZ#~rt8#90Y_Xh&3U-< z{s<&cCV_1`^TD^ia9!*mQDq& zn2{r`j};V|uV%_wsP!zB?m%;FeaRe+X47K0e+KE!8C{gAWF8)lCd1u1%~|M!XNRvw zvtqy3iz0WSpWdhn6$hP8PaRBmp)q`#PCA`Vd#Tc$@f1tAcM>f_I@bC)hkI9|o(Iqv zo}Piadq!j76}004RBio<`)70k^`K1NK)q>w?p^C6J2ZC!+UppiK6&y3Kmbv&O!oYF z34$0Z;QO!JOY#!`qyGH<3Pd}Pt@q*A0V=3SVtWKRR8d8Z&@)3qLPA19LPA19LPEUC YUoZo%k(ykuW&i*H07*qoM6N<$f+CH{y8r+H literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..0bedcf2 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9da19eacad3b03bb08bbddbbf4ac48dd78b3d838 GIT binary patch literal 68 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>Zci7-kcv6Uzs@r-FtIZ-&5|)J Q1PU{Fy85}Sb4q9e0B4a5jsO4v literal 0 HcmV?d00001 diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 0000000..89c2725 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/ios/Runner/Base.lproj/LaunchScreen.storyboard b/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f2e259c --- /dev/null +++ b/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Base.lproj/Main.storyboard b/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 0000000..f3c2851 --- /dev/null +++ b/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist new file mode 100644 index 0000000..937f7d6 --- /dev/null +++ b/ios/Runner/Info.plist @@ -0,0 +1,70 @@ + + + + + CADisableMinimumFrameDurationOnPhone + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Krow Worker App + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + krow_worker_app + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 0000000..308a2a5 --- /dev/null +++ b/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/ios/Runner/SceneDelegate.swift b/ios/Runner/SceneDelegate.swift new file mode 100644 index 0000000..b9ce8ea --- /dev/null +++ b/ios/Runner/SceneDelegate.swift @@ -0,0 +1,6 @@ +import Flutter +import UIKit + +class SceneDelegate: FlutterSceneDelegate { + +} diff --git a/ios/RunnerTests/RunnerTests.swift b/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 0000000..86a7c3b --- /dev/null +++ b/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/lib/core/formatters.dart b/lib/core/formatters.dart new file mode 100644 index 0000000..bb1234c --- /dev/null +++ b/lib/core/formatters.dart @@ -0,0 +1,51 @@ +import 'package:intl/intl.dart'; + +final _money = NumberFormat.currency(locale: 'en_US', symbol: r'$'); +final _time = DateFormat('h:mm a'); +final _dayFull = DateFormat('EEEE d MMMM'); +final _dayShort = DateFormat('EEE, d MMM yyyy'); +final _monthYear = DateFormat('MMMM yyyy'); + +abstract final class Fmt { + static String money(num v) => _money.format(v); + + static String time(DateTime d) => _time.format(d); + + static String window(DateTime start, DateTime end) => + '${_time.format(start)} - ${_time.format(end)}'; + + static String dayFull(DateTime d) => _dayFull.format(d); + + static String dayShort(DateTime d) => _dayShort.format(d); + + static String monthYear(DateTime d) => _monthYear.format(d); + + /// `5h 48m`, the form used on every hours figure. + static String duration(Duration d) { + final h = d.inHours; + final m = d.inMinutes.remainder(60); + if (h == 0) return '${m}m'; + return '${h}h ${m.toString().padLeft(2, '0')}m'; + } + + /// `05:48:12`, for the running clock-in timer. + static String stopwatch(Duration d) { + final h = d.inHours.toString().padLeft(2, '0'); + final m = d.inMinutes.remainder(60).toString().padLeft(2, '0'); + final s = d.inSeconds.remainder(60).toString().padLeft(2, '0'); + return '$h:$m:$s'; + } + + /// A human countdown to a shift start: `in 41 min`, `in 3 hr`, `tomorrow`. + static String untilStart(DateTime start, {DateTime? now}) { + final from = now ?? DateTime.now(); + final diff = start.difference(from); + if (diff.isNegative) return 'Started'; + if (diff.inMinutes < 60) return 'In ${diff.inMinutes} min'; + if (diff.inHours < 24) return 'In ${diff.inHours} hr'; + return 'In ${diff.inDays} d'; + } + + static bool sameDay(DateTime a, DateTime b) => + a.year == b.year && a.month == b.month && a.day == b.day; +} diff --git a/lib/core/router.dart b/lib/core/router.dart new file mode 100644 index 0000000..dbbe6ea --- /dev/null +++ b/lib/core/router.dart @@ -0,0 +1,137 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +import '../screens/auth_screens.dart'; +import '../screens/availability_screen.dart'; +import '../screens/clock_screen.dart'; +import '../screens/compliance_screens.dart'; +import '../screens/home_shell.dart'; +import '../screens/onboarding_screens.dart'; +import '../screens/pay_screens.dart'; +import '../screens/profile_detail_screens.dart'; +import '../screens/profile_screen.dart'; +import '../screens/settings_screens.dart'; +import '../screens/shift_detail_screen.dart'; +import '../screens/shifts_screen.dart'; +import '../screens/timecard_screens.dart'; +import '../screens/today_screen.dart'; +import '../state/compliance_controller.dart'; +import 'transitions.dart'; + +final _rootKey = GlobalKey(); + +ComplianceSection _sectionFromName(String name) => + ComplianceSection.values.firstWhere( + (s) => s.name == name, + orElse: () => ComplianceSection.documents, + ); + +/// A screen that replaces what came before it. +GoRoute _fadeRoute(String path, Widget Function() build) => GoRoute( + path: path, + pageBuilder: (_, state) => Transitions.fade(state, build()), +); + +/// A screen pushed on top of the shell. +GoRoute _detailRoute( + String path, + Widget Function(GoRouterState) build, { + List routes = const [], +}) => GoRoute( + path: path, + parentNavigatorKey: _rootKey, + pageBuilder: (_, state) => Transitions.push(state, build(state)), + routes: routes, +); + +/// Sign-in lives outside the shell; the five tabs each keep their own stack, +/// and detail screens push over the whole shell. +final router = GoRouter( + navigatorKey: _rootKey, + initialLocation: '/', + routes: [ + _fadeRoute('/', SplashScreen.new), + _fadeRoute('/onboarding', OnboardingScreen.new), + _fadeRoute('/welcome', WelcomeScreen.new), + _fadeRoute('/verified', VerifiedScreen.new), + _fadeRoute('/permissions', PermissionsScreen.new), + + // The two sign-in steps are pushed, so back gestures read correctly. + _detailRoute('/phone', (_) => const PhoneScreen()), + _detailRoute('/otp', (_) => const OtpScreen()), + + StatefulShellRoute.indexedStack( + builder: (_, _, shell) => HomeShell(navigationShell: shell), + branches: [ + StatefulShellBranch( + routes: [ + GoRoute(path: '/today', builder: (_, _) => const TodayScreen()), + ], + ), + StatefulShellBranch( + routes: [ + GoRoute(path: '/shifts', builder: (_, _) => const ShiftsScreen()), + ], + ), + StatefulShellBranch( + routes: [ + GoRoute(path: '/clock', builder: (_, _) => const ClockScreen()), + ], + ), + StatefulShellBranch( + routes: [GoRoute(path: '/pay', builder: (_, _) => const PayScreen())], + ), + StatefulShellBranch( + routes: [ + GoRoute(path: '/profile', builder: (_, _) => const ProfileScreen()), + ], + ), + ], + ), + + _detailRoute( + '/shift/:id', + (state) => ShiftDetailScreen(shiftId: state.pathParameters['id']!), + ), + _detailRoute('/availability', (_) => const AvailabilityScreen()), + _detailRoute('/timecards', (_) => const TimecardsScreen()), + _detailRoute( + '/timecard/:id', + (state) => TimecardReviewScreen(timecardId: state.pathParameters['id']!), + ), + _detailRoute('/payroll', (_) => const PayrollScheduleScreen()), + _detailRoute( + '/payment/:id', + (state) => PaymentDetailScreen(shiftId: state.pathParameters['id']!), + ), + _detailRoute( + '/compliance', + (_) => const ComplianceHubScreen(), + routes: [ + _detailRoute( + ':section', + (state) => ComplianceListScreen( + section: _sectionFromName(state.pathParameters['section']!), + ), + routes: [ + _detailRoute( + ':itemId', + (state) => ComplianceDetailScreen( + section: _sectionFromName(state.pathParameters['section']!), + itemId: state.pathParameters['itemId']!, + ), + ), + ], + ), + ], + ), + _detailRoute('/emergency-contacts', (_) => const EmergencyContactsScreen()), + _detailRoute('/skills', (_) => const SkillsScreen()), + _detailRoute('/direct-deposit', (_) => const DirectDepositScreen()), + _detailRoute('/benefits', (_) => const BenefitsScreen()), + _detailRoute('/settings', (_) => const SettingsScreen()), + _detailRoute('/support', (_) => const SupportScreen()), + _detailRoute('/faqs', (_) => const FaqScreen()), + _detailRoute('/privacy', (_) => const PrivacyScreen()), + ], +); diff --git a/lib/core/theme.dart b/lib/core/theme.dart new file mode 100644 index 0000000..7051b6a --- /dev/null +++ b/lib/core/theme.dart @@ -0,0 +1,144 @@ +import 'package:flutter/material.dart'; +import 'package:google_fonts/google_fonts.dart'; + +/// KROW brand palette: 286CP blue carries every surface and action, 106CP +/// yellow marks money and anything waiting on you, 621CP sage is the canvas. +abstract final class KrowPalette { + static const blue = Color(0xFF3752A8); + static const blueDeep = Color(0xFF22366F); + static const blueTint = Color(0xFFE1E6F4); + static const yellow = Color(0xFFF5C842); + static const yellowSoft = Color(0xFFF7E4AE); + static const sage = Color(0xFFE9F3EC); + static const ink = Color(0xFF26353E); + static const line = Color(0xFFCFDDD3); + static const mute = Color(0xFF65727A); +} + +ThemeData buildKrowTheme() { + final scheme = ColorScheme.fromSeed( + seedColor: KrowPalette.blue, + primary: KrowPalette.blue, + onPrimary: Colors.white, + secondary: KrowPalette.yellow, + onSecondary: KrowPalette.ink, + surface: Colors.white, + onSurface: KrowPalette.ink, + brightness: Brightness.light, + ); + + final text = GoogleFonts.poppinsTextTheme().apply( + bodyColor: KrowPalette.ink, + displayColor: KrowPalette.ink, + ); + + return ThemeData( + useMaterial3: true, + colorScheme: scheme, + textTheme: text, + scaffoldBackgroundColor: KrowPalette.sage, + appBarTheme: AppBarTheme( + backgroundColor: KrowPalette.sage, + surfaceTintColor: Colors.transparent, + foregroundColor: KrowPalette.ink, + elevation: 0, + centerTitle: false, + titleTextStyle: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w700, + color: KrowPalette.ink, + ), + ), + cardTheme: CardThemeData( + color: Colors.white, + elevation: 0, + margin: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + side: const BorderSide(color: KrowPalette.line), + ), + ), + dividerTheme: const DividerThemeData( + color: KrowPalette.line, + thickness: 1, + space: 1, + ), + filledButtonTheme: FilledButtonThemeData( + style: FilledButton.styleFrom( + minimumSize: const Size.fromHeight(52), + backgroundColor: KrowPalette.blue, + foregroundColor: Colors.white, + disabledBackgroundColor: const Color(0xFFD5E2D9), + disabledForegroundColor: const Color(0xFF949FA5), + textStyle: GoogleFonts.poppins( + fontSize: 15, + fontWeight: FontWeight.w600, + ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), + ), + ), + outlinedButtonTheme: OutlinedButtonThemeData( + style: OutlinedButton.styleFrom( + minimumSize: const Size.fromHeight(52), + foregroundColor: KrowPalette.ink, + backgroundColor: Colors.white, + side: const BorderSide(color: KrowPalette.line), + textStyle: GoogleFonts.poppins( + fontSize: 15, + fontWeight: FontWeight.w600, + ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), + ), + ), + textButtonTheme: TextButtonThemeData( + style: TextButton.styleFrom( + foregroundColor: KrowPalette.blue, + textStyle: GoogleFonts.poppins( + fontSize: 14, + fontWeight: FontWeight.w600, + ), + ), + ), + inputDecorationTheme: InputDecorationTheme( + filled: true, + fillColor: Colors.white, + contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), + hintStyle: GoogleFonts.poppins( + fontSize: 14, + color: const Color(0xFF949FA5), + ), + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: KrowPalette.line), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: KrowPalette.line), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.circular(14), + borderSide: const BorderSide(color: KrowPalette.blue, width: 1.6), + ), + ), + chipTheme: ChipThemeData( + backgroundColor: Colors.white, + side: const BorderSide(color: KrowPalette.line), + labelStyle: GoogleFonts.poppins( + fontSize: 12.5, + fontWeight: FontWeight.w500, + ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), + ), + // Bottom navigation is KrowNavBar, not Material's NavigationBar, so there + // is no navigationBarTheme to configure — its styling lives in the widget. + snackBarTheme: SnackBarThemeData( + behavior: SnackBarBehavior.floating, + backgroundColor: KrowPalette.ink, + contentTextStyle: GoogleFonts.poppins( + fontSize: 13.5, + color: Colors.white, + ), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)), + ), + ); +} diff --git a/lib/core/transitions.dart b/lib/core/transitions.dart new file mode 100644 index 0000000..ec0f706 --- /dev/null +++ b/lib/core/transitions.dart @@ -0,0 +1,84 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; + +/// Page transitions, kept in one place so every screen arrives the same way. +/// +/// Two kinds only. Moving *deeper* (a shift, a document, a timecard) slides +/// forward, and the screen behind it slides back a little so the stack reads +/// as a stack. Moving *sideways* — between steps of sign-up, or replacing the +/// whole screen — cross-fades, because nothing is being pushed onto anything. +abstract final class Transitions { + static const _forward = Duration(milliseconds: 320); + static const _back = Duration(milliseconds: 260); + + /// Pushed detail screens. + static CustomTransitionPage push(GoRouterState state, Widget child) { + return CustomTransitionPage( + key: state.pageKey, + child: child, + transitionDuration: _forward, + reverseTransitionDuration: _back, + transitionsBuilder: (context, animation, secondaryAnimation, child) { + final incoming = CurvedAnimation( + parent: animation, + curve: Curves.easeOutCubic, + reverseCurve: Curves.easeInCubic, + ); + // The outgoing screen eases back rather than sitting still, which is + // what gives the push its depth. + final outgoing = CurvedAnimation( + parent: secondaryAnimation, + curve: Curves.easeOutCubic, + reverseCurve: Curves.easeInCubic, + ); + + // secondaryAnimation rests at 0 while this page is on top, so the + // resting state has to be `begin`. Reversing these two leaves every + // pushed screen sitting 12% off to the left. + return SlideTransition( + position: Tween( + begin: Offset.zero, + end: const Offset(-0.12, 0), + ).animate(outgoing), + child: FadeTransition( + opacity: Tween(begin: 1.0, end: 0.0).animate(outgoing), + child: SlideTransition( + position: Tween( + begin: const Offset(1, 0), + end: Offset.zero, + ).animate(incoming), + child: child, + ), + ), + ); + }, + ); + } + + /// Screens that replace what came before: splash, onboarding, sign-in steps. + static CustomTransitionPage fade(GoRouterState state, Widget child) { + return CustomTransitionPage( + key: state.pageKey, + child: child, + transitionDuration: _forward, + reverseTransitionDuration: _back, + transitionsBuilder: (context, animation, secondaryAnimation, child) { + final curved = CurvedAnimation( + parent: animation, + curve: Curves.easeOutCubic, + ); + return FadeTransition( + opacity: curved, + // A few pixels of rise stops the cross-fade feeling inert. + child: SlideTransition( + position: Tween( + begin: const Offset(0, 0.015), + end: Offset.zero, + ).animate(curved), + child: child, + ), + ); + }, + ); + } +} diff --git a/lib/main.dart b/lib/main.dart new file mode 100644 index 0000000..255c641 --- /dev/null +++ b/lib/main.dart @@ -0,0 +1,73 @@ +import 'package:flutter/gestures.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import 'core/router.dart'; +import 'core/theme.dart'; +import 'state/session_controller.dart'; + +Future main() async { + WidgetsFlutterBinding.ensureInitialized(); + final prefs = await SharedPreferences.getInstance(); + + SystemChrome.setSystemUIOverlayStyle( + const SystemUiOverlayStyle( + statusBarColor: Colors.transparent, + statusBarIconBrightness: Brightness.light, + ), + ); + + runApp( + ProviderScope( + overrides: [prefsProvider.overrideWithValue(prefs)], + child: const KrowApp(), + ), + ); +} + +class KrowApp extends StatelessWidget { + const KrowApp({super.key}); + + @override + Widget build(BuildContext context) { + return MaterialApp.router( + title: 'KROW Worker', + debugShowCheckedModeBanner: false, + theme: buildKrowTheme(), + scrollBehavior: const KrowScrollBehavior(), + routerConfig: router, + ); + } +} + +/// Scrolling feel, applied everywhere. +class KrowScrollBehavior extends MaterialScrollBehavior { + const KrowScrollBehavior(); + + /// Bouncing on every platform. The lists here sit under a pinned header, and + /// a rubber-band edge shows you have reached the end of the content rather + /// than the end of the screen — clamping just stops dead against the header. + @override + ScrollPhysics getScrollPhysics(BuildContext context) => + const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()); + + /// Let the web and desktop builds be dragged with a mouse or trackpad, not + /// only scrolled with a wheel. + @override + Set get dragDevices => { + PointerDeviceKind.touch, + PointerDeviceKind.mouse, + PointerDeviceKind.trackpad, + PointerDeviceKind.stylus, + }; + + /// The bounce is the end-of-list signal; a glow on top of it is noise. + @override + Widget buildOverscrollIndicator( + BuildContext context, + Widget child, + ScrollableDetails details, + ) => child; +} diff --git a/lib/models/availability.dart b/lib/models/availability.dart new file mode 100644 index 0000000..e41c0e2 --- /dev/null +++ b/lib/models/availability.dart @@ -0,0 +1,21 @@ +enum DayBlock { morning, afternoon, evening } + +extension DayBlockX on DayBlock { + String get label => switch (this) { + DayBlock.morning => 'Morning', + DayBlock.afternoon => 'Afternoon', + DayBlock.evening => 'Evening', + }; + + String get window => switch (this) { + DayBlock.morning => '04:00 - 12:00', + DayBlock.afternoon => '12:00 - 18:00', + DayBlock.evening => '18:00 - 24:00', + }; + + int get hours => switch (this) { + DayBlock.morning => 8, + DayBlock.afternoon => 6, + DayBlock.evening => 6, + }; +} diff --git a/lib/models/compliance.dart b/lib/models/compliance.dart new file mode 100644 index 0000000..c83a68f --- /dev/null +++ b/lib/models/compliance.dart @@ -0,0 +1,82 @@ +enum ComplianceState { verified, pending, missing } + +extension ComplianceStateX on ComplianceState { + String get label => switch (this) { + ComplianceState.verified => 'Verified', + ComplianceState.pending => 'Pending', + ComplianceState.missing => 'Missing', + }; +} + +/// A single thing a business must see before you can work: a document, a +/// certificate, a tax form or a piece of attire. +class ComplianceItem { + ComplianceItem({ + required this.id, + required this.title, + required this.subtitle, + required this.state, + this.statusLabel, + this.fileName, + this.fileMeta, + this.expires, + this.required_ = true, + }); + + final String id; + final String title; + final String subtitle; + final ComplianceState state; + final String? statusLabel; + final String? fileName; + final String? fileMeta; + final DateTime? expires; + final bool required_; + + String get badge => statusLabel ?? state.label; + + ComplianceItem copyWith({ + ComplianceState? state, + String? statusLabel, + String? fileName, + String? fileMeta, + DateTime? expires, + bool clearFile = false, + }) => ComplianceItem( + id: id, + title: title, + subtitle: subtitle, + state: state ?? this.state, + statusLabel: statusLabel ?? this.statusLabel, + fileName: clearFile ? null : (fileName ?? this.fileName), + fileMeta: clearFile ? null : (fileMeta ?? this.fileMeta), + expires: expires ?? this.expires, + required_: required_, + ); +} + +class EmergencyContact { + EmergencyContact({ + required this.name, + required this.phone, + required this.relationship, + }); + + final String name; + final String phone; + final String relationship; +} + +class BankAccount { + BankAccount({ + required this.bankName, + required this.routing, + required this.accountLast4, + required this.accountType, + }); + + final String bankName; + final String routing; + final String accountLast4; + final String accountType; +} diff --git a/lib/models/shift.dart b/lib/models/shift.dart new file mode 100644 index 0000000..fcdf8ea --- /dev/null +++ b/lib/models/shift.dart @@ -0,0 +1,95 @@ +enum ShiftStatus { open, booked, active, completed, cancelled, noShow } + +extension ShiftStatusX on ShiftStatus { + String get label => switch (this) { + ShiftStatus.open => 'Open', + ShiftStatus.booked => 'Confirmed', + ShiftStatus.active => 'In progress', + ShiftStatus.completed => 'Completed', + ShiftStatus.cancelled => 'Cancelled', + ShiftStatus.noShow => 'No show', + }; +} + +class Shift { + Shift({ + required this.id, + required this.role, + required this.business, + required this.venue, + required this.address, + required this.start, + required this.end, + required this.rate, + required this.status, + this.breakMinutes = 30, + this.distanceMiles = 2.4, + this.manager, + this.clockIn, + this.clockOut, + this.requirements = const [], + }); + + final String id; + final String role; + final String business; + final String venue; + final String address; + final DateTime start; + final DateTime end; + final double rate; + final ShiftStatus status; + final int breakMinutes; + final double distanceMiles; + final String? manager; + final DateTime? clockIn; + final DateTime? clockOut; + final List requirements; + + /// Paid duration: the scheduled window less the unpaid break. + Duration get scheduledDuration => + end.difference(start) - Duration(minutes: breakMinutes); + + /// What was actually worked, once clocked out. + Duration? get workedDuration { + if (clockIn == null || clockOut == null) return null; + final d = clockOut!.difference(clockIn!) - Duration(minutes: breakMinutes); + return d.isNegative ? Duration.zero : d; + } + + double get scheduledPay => rate * scheduledDuration.inMinutes / 60; + + /// Gross, pre-tax. Falls back to the scheduled figure until clocked out. + double get pay { + if (status == ShiftStatus.cancelled || status == ShiftStatus.noShow) { + return 0; + } + final worked = workedDuration; + if (worked != null) return rate * worked.inMinutes / 60; + return scheduledPay; + } + + String get logoLetter => business.isEmpty ? '?' : business[0].toUpperCase(); + + Shift copyWith({ + ShiftStatus? status, + DateTime? clockIn, + DateTime? clockOut, + }) => Shift( + id: id, + role: role, + business: business, + venue: venue, + address: address, + start: start, + end: end, + rate: rate, + status: status ?? this.status, + breakMinutes: breakMinutes, + distanceMiles: distanceMiles, + manager: manager, + clockIn: clockIn ?? this.clockIn, + clockOut: clockOut ?? this.clockOut, + requirements: requirements, + ); +} diff --git a/lib/models/timecard.dart b/lib/models/timecard.dart new file mode 100644 index 0000000..a45e80e --- /dev/null +++ b/lib/models/timecard.dart @@ -0,0 +1,70 @@ +enum TimecardStatus { needsReview, approved, disputed } + +extension TimecardStatusX on TimecardStatus { + String get label => switch (this) { + TimecardStatus.needsReview => 'Needs review', + TimecardStatus.approved => 'Approved', + TimecardStatus.disputed => 'Disputed', + }; +} + +class Timecard { + Timecard({ + required this.id, + required this.shiftId, + required this.role, + required this.business, + required this.scheduledStart, + required this.scheduledEnd, + required this.clockIn, + required this.clockOut, + required this.breakMinutes, + required this.rate, + required this.status, + required this.submittedAt, + this.disputeNote, + }); + + final String id; + final String shiftId; + final String role; + final String business; + final DateTime scheduledStart; + final DateTime scheduledEnd; + final DateTime clockIn; + final DateTime clockOut; + final int breakMinutes; + final double rate; + final TimecardStatus status; + final DateTime submittedAt; + final String? disputeNote; + + DateTime get date => + DateTime(scheduledStart.year, scheduledStart.month, scheduledStart.day); + + Duration get worked { + final d = clockOut.difference(clockIn) - Duration(minutes: breakMinutes); + return d.isNegative ? Duration.zero : d; + } + + double get amount => rate * worked.inMinutes / 60; + + /// Minutes late (positive) or early (negative) against the schedule. + int get varianceMinutes => clockIn.difference(scheduledStart).inMinutes; + + Timecard copyWith({TimecardStatus? status, String? disputeNote}) => Timecard( + id: id, + shiftId: shiftId, + role: role, + business: business, + scheduledStart: scheduledStart, + scheduledEnd: scheduledEnd, + clockIn: clockIn, + clockOut: clockOut, + breakMinutes: breakMinutes, + rate: rate, + status: status ?? this.status, + submittedAt: submittedAt, + disputeNote: disputeNote ?? this.disputeNote, + ); +} diff --git a/lib/models/worker.dart b/lib/models/worker.dart new file mode 100644 index 0000000..6a7b07d --- /dev/null +++ b/lib/models/worker.dart @@ -0,0 +1,57 @@ +class Worker { + const Worker({ + required this.name, + required this.role, + required this.city, + required this.phone, + this.shiftsWorked = 0, + this.rating = 5.0, + this.onTimePercent = 100, + this.noShows = 0, + this.cancellations = 0, + }); + + final String name; + final String role; + final String city; + final String phone; + final int shiftsWorked; + final double rating; + final int onTimePercent; + final int noShows; + final int cancellations; + + /// Stay above 45% to keep picking up shifts. On-time arrivals move it most. + int get trustIndex { + final base = 40 + onTimePercent ~/ 2 - noShows * 15 - cancellations * 5; + return base.clamp(0, 100); + } + + String get initials => name + .split(' ') + .where((p) => p.isNotEmpty) + .map((p) => p[0].toUpperCase()) + .take(2) + .join(); + + Worker copyWith({ + String? name, + String? role, + String? city, + String? phone, + int? shiftsWorked, + int? onTimePercent, + int? noShows, + int? cancellations, + }) => Worker( + name: name ?? this.name, + role: role ?? this.role, + city: city ?? this.city, + phone: phone ?? this.phone, + shiftsWorked: shiftsWorked ?? this.shiftsWorked, + rating: rating, + onTimePercent: onTimePercent ?? this.onTimePercent, + noShows: noShows ?? this.noShows, + cancellations: cancellations ?? this.cancellations, + ); +} diff --git a/lib/screens/auth_screens.dart b/lib/screens/auth_screens.dart new file mode 100644 index 0000000..c1afa04 --- /dev/null +++ b/lib/screens/auth_screens.dart @@ -0,0 +1,650 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; +import '../state/session_controller.dart'; +import '../widgets/common.dart'; + +/// Step 1 of 2: the mobile number a shift manager would text. +class PhoneScreen extends ConsumerStatefulWidget { + const PhoneScreen({super.key}); + + @override + ConsumerState createState() => _PhoneScreenState(); +} + +class _PhoneScreenState extends ConsumerState { + final _controller = TextEditingController(); + bool get _valid => + _controller.text.replaceAll(RegExp(r'\D'), '').length >= 10; + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + void _send() { + final phone = '+1 ${_controller.text.trim()}'; + ref.read(sessionProvider.notifier).sendCode(phone); + context.push('/otp'); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(leading: const BackButton()), + body: SafeArea( + child: SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(20, 4, 20, 24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SectionLabel('Step 1 of 2'), + const Text( + "What's your\nmobile number?", + style: TextStyle( + fontSize: 29, + fontWeight: FontWeight.w700, + height: 1.1, + letterSpacing: -1, + ), + ), + const SizedBox(height: 10), + const Text( + 'Shift managers text you here, and we will send a 6-digit code ' + 'to confirm it is yours.', + style: TextStyle( + fontSize: 14, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 24), + TextField( + controller: _controller, + autofocus: true, + keyboardType: TextInputType.phone, + onChanged: (_) => setState(() {}), + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp(r'[0-9 ]')), + LengthLimitingTextInputFormatter(14), + ], + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w600, + letterSpacing: 0.6, + ), + decoration: const InputDecoration( + hintText: '408 555 0148', + prefixIcon: Padding( + padding: EdgeInsets.fromLTRB(16, 15, 10, 15), + child: Text( + '+1', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + ), + ), + ), + prefixIconConstraints: BoxConstraints(minWidth: 0), + ), + ), + const SizedBox(height: 10), + const Text( + 'Message and data rates may apply. Reply STOP any time to opt ' + 'out.', + style: TextStyle( + fontSize: 12, + height: 1.5, + color: Color(0xFF949FA5), + ), + ), + const SizedBox(height: 26), + FilledButton( + onPressed: _valid ? _send : null, + child: const Text('Send code'), + ), + const SizedBox(height: 10), + Center( + child: TextButton( + onPressed: () => ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('Email sign-in is coming soon'), + ), + ), + child: const Text('Verify with email instead'), + ), + ), + ], + ), + ), + ), + ); + } +} + +/// Step 2 of 2: the code, with a resend countdown and a limited try budget. +class OtpScreen extends ConsumerStatefulWidget { + const OtpScreen({super.key}); + + @override + ConsumerState createState() => _OtpScreenState(); +} + +class _OtpScreenState extends ConsumerState { + final _controller = TextEditingController(); + Timer? _timer; + int _secondsLeft = 30; + int _triesLeft = 3; + String? _error; + + @override + void initState() { + super.initState(); + _startCountdown(); + } + + @override + void dispose() { + _timer?.cancel(); + _controller.dispose(); + super.dispose(); + } + + void _startCountdown() { + _timer?.cancel(); + setState(() => _secondsLeft = 30); + _timer = Timer.periodic(const Duration(seconds: 1), (t) { + if (!mounted) return; + if (_secondsLeft <= 1) { + t.cancel(); + setState(() => _secondsLeft = 0); + } else { + setState(() => _secondsLeft--); + } + }); + } + + void _verify() { + final ok = ref.read(sessionProvider.notifier).verifyCode(_controller.text); + if (ok) { + context.go('/verified'); + return; + } + setState(() { + _triesLeft--; + _error = _triesLeft > 0 + ? 'That code does not match. Check the most recent text - older ' + 'codes stop working. $_triesLeft tries left.' + : 'Too many attempts. Request a new code to try again.'; + }); + } + + @override + Widget build(BuildContext context) { + final phone = ref.watch(sessionProvider).phone ?? ''; + final canVerify = _controller.text.length == 6 && _triesLeft > 0; + + return Scaffold( + appBar: AppBar(leading: const BackButton()), + body: SafeArea( + child: SingleChildScrollView( + padding: const EdgeInsets.fromLTRB(20, 4, 20, 24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SectionLabel('Step 2 of 2'), + const Text( + 'Enter the code', + style: TextStyle( + fontSize: 29, + fontWeight: FontWeight.w700, + letterSpacing: -1, + ), + ), + const SizedBox(height: 10), + Row( + children: [ + Text( + 'Texted to $phone', + style: const TextStyle( + fontSize: 13.5, + color: KrowPalette.mute, + ), + ), + TextButton( + onPressed: () => context.pop(), + child: const Text('Change'), + ), + ], + ), + const SizedBox(height: 8), + TextField( + controller: _controller, + autofocus: true, + keyboardType: TextInputType.number, + textAlign: TextAlign.center, + maxLength: 6, + onChanged: (_) => setState(() => _error = null), + inputFormatters: [FilteringTextInputFormatter.digitsOnly], + style: const TextStyle( + fontSize: 30, + fontWeight: FontWeight.w700, + letterSpacing: 14, + ), + decoration: InputDecoration( + counterText: '', + hintText: '------', + errorText: _error, + errorMaxLines: 3, + hintStyle: const TextStyle( + fontSize: 30, + letterSpacing: 14, + color: Color(0xFFC4D4C9), + ), + ), + ), + const SizedBox(height: 14), + const InfoBanner('Demo build: the code is always 123456.'), + const SizedBox(height: 16), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + "Didn't get the text?", + style: TextStyle(fontSize: 13, color: KrowPalette.mute), + ), + if (_secondsLeft > 0) + Text( + 'Resend in 0:${_secondsLeft.toString().padLeft(2, '0')}', + style: const TextStyle( + fontSize: 12.5, + color: Color(0xFF949FA5), + ), + ) + else + TextButton( + onPressed: () { + setState(() { + _triesLeft = 3; + _error = null; + }); + _startCountdown(); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('New code sent')), + ); + }, + child: const Text('Resend code'), + ), + ], + ), + const SizedBox(height: 18), + FilledButton( + onPressed: canVerify ? _verify : null, + child: const Text('Verify number'), + ), + ], + ), + ), + ), + ); + } +} + +/// Confirmation, plus the two things still standing between the worker and +/// their first shift. +class VerifiedScreen extends ConsumerWidget { + const VerifiedScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final phone = ref.watch(sessionProvider).phone ?? ''; + return Scaffold( + backgroundColor: KrowPalette.blue, + body: Column( + children: [ + Expanded( + child: SafeArea( + bottom: false, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 26), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 86, + height: 86, + decoration: const BoxDecoration( + color: KrowPalette.yellow, + shape: BoxShape.circle, + ), + child: const Icon( + LucideIcons.check, + size: 40, + color: KrowPalette.ink, + ), + ), + const SizedBox(height: 26), + const Text( + 'Number verified', + style: TextStyle( + fontSize: 30, + fontWeight: FontWeight.w700, + letterSpacing: -1, + color: Colors.white, + ), + ), + const SizedBox(height: 10), + Text( + phone, + style: const TextStyle( + fontSize: 15, + fontWeight: FontWeight.w600, + color: KrowPalette.yellow, + ), + ), + const SizedBox(height: 14), + Text( + 'Two things left before you can accept shifts.', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14, + height: 1.55, + color: Colors.white.withValues(alpha: 0.62), + ), + ), + const SizedBox(height: 26), + const _TodoRow( + title: 'Upload your ID', + subtitle: 'State ID or passport', + badge: '2 min', + ), + const SizedBox(height: 10), + const _TodoRow( + title: 'Set your availability', + subtitle: 'So we only send shifts you can work', + badge: '1 min', + ), + ], + ), + ), + ), + ), + Container( + width: double.infinity, + decoration: const BoxDecoration( + color: KrowPalette.sage, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: SafeArea( + top: false, + child: Padding( + padding: const EdgeInsets.fromLTRB(20, 22, 20, 16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FilledButton( + onPressed: () => context.go('/permissions'), + child: const Text('Continue'), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + +class _TodoRow extends StatelessWidget { + const _TodoRow({ + required this.title, + required this.subtitle, + required this.badge, + }); + + final String title; + final String subtitle; + final String badge; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.08), + borderRadius: BorderRadius.circular(14), + border: Border.all(color: Colors.white24), + ), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ), + const SizedBox(height: 2), + Text( + subtitle, + style: TextStyle( + fontSize: 12.5, + color: Colors.white.withValues(alpha: 0.55), + ), + ), + ], + ), + ), + StatusChip(badge, tone: ChipTone.yellow), + ], + ), + ); + } +} + +class _Permission { + const _Permission(this.icon, this.step, this.title, this.body, this.reasons); + + final IconData icon; + final String step; + final String title; + final String body; + final List reasons; +} + +/// The three-step permission run. Each grant is recorded in the session so the +/// app knows what it is allowed to do later. +class PermissionsScreen extends ConsumerStatefulWidget { + const PermissionsScreen({super.key}); + + @override + ConsumerState createState() => _PermissionsScreenState(); +} + +class _PermissionsScreenState extends ConsumerState { + int _step = 0; + + static const _permissions = [ + _Permission( + LucideIcons.mapPin, + 'Step 1 of 3', + 'Let KROW see where you are', + 'Clock-in is locked until you are within 150 m of the venue. Without ' + 'location you cannot start a shift.', + [ + 'Unlocks clock in when you arrive', + 'Sorts shifts by distance from you', + 'Only read while a shift is active', + ], + ), + _Permission( + LucideIcons.bell, + 'Step 2 of 3', + 'Turn on notifications', + 'Shift offers are first-come. If your phone is silent someone else takes ' + 'the shift.', + [ + 'New shift offers matched to you', + 'Clock-in reminders 30 min before', + 'Pay alerts when money lands', + ], + ), + _Permission( + LucideIcons.camera, + 'Step 3 of 3', + 'Camera and photos', + 'Attire and document checks need a photo of the real item. Nothing is ' + 'uploaded until you tap send.', + [ + 'Photograph your uniform items', + 'Capture ID and certificates', + 'Nothing is stored on our servers unsent', + ], + ), + ]; + + void _advance({required bool granted}) { + final notifier = ref.read(sessionProvider.notifier); + if (granted) { + switch (_step) { + case 0: + notifier.grantLocation(); + case 1: + notifier.grantNotifications(); + case 2: + notifier.grantCamera(); + } + } + if (_step == _permissions.length - 1) { + context.go('/today'); + } else { + setState(() => _step++); + } + } + + @override + Widget build(BuildContext context) { + final p = _permissions[_step]; + return Scaffold( + body: SafeArea( + child: Padding( + padding: const EdgeInsets.fromLTRB(22, 24, 22, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // The copy scrolls if it has to; the actions stay pinned, so a + // short screen or a large text scale can never push them off. + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 60, + height: 60, + decoration: BoxDecoration( + color: KrowPalette.blue, + borderRadius: BorderRadius.circular(18), + ), + child: Icon(p.icon, size: 27, color: Colors.white), + ), + SectionLabel(p.step), + Text( + p.title, + style: const TextStyle( + fontSize: 25, + fontWeight: FontWeight.w700, + height: 1.15, + letterSpacing: -0.9, + ), + ), + const SizedBox(height: 10), + Text( + p.body, + style: const TextStyle( + fontSize: 14, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 18), + for (final reason in p.reasons) + Padding( + padding: const EdgeInsets.only(bottom: 12), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 20, + height: 20, + // Nudged to sit on the first line's optical + // centre, so wrapped reasons stay top-aligned. + margin: const EdgeInsets.only(top: 1), + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(7), + ), + child: const Icon( + LucideIcons.check, + size: 12, + color: KrowPalette.blue, + ), + ), + const SizedBox(width: 11), + Expanded( + child: Text( + reason, + style: const TextStyle( + fontSize: 13, + height: 1.45, + color: KrowPalette.mute, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + const SizedBox(height: 16), + FilledButton( + onPressed: () => _advance(granted: true), + child: Text(switch (_step) { + 0 => 'Allow location', + 1 => 'Turn on notifications', + _ => 'Allow camera', + }), + ), + const SizedBox(height: 4), + // Full width so the secondary action shares the primary's edges + // rather than hugging the left. + TextButton( + onPressed: () => _advance(granted: false), + style: TextButton.styleFrom( + minimumSize: const Size.fromHeight(44), + ), + child: const Text('Not now'), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/availability_screen.dart b/lib/screens/availability_screen.dart new file mode 100644 index 0000000..aff9bf9 --- /dev/null +++ b/lib/screens/availability_screen.dart @@ -0,0 +1,337 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/availability.dart'; +import '../state/availability_controller.dart'; +import '../widgets/common.dart'; +import '../widgets/week_strip.dart'; + +/// Auto-Match only offers shifts inside the blocks switched on here. +class AvailabilityScreen extends ConsumerStatefulWidget { + const AvailabilityScreen({super.key}); + + @override + ConsumerState createState() => _AvailabilityScreenState(); +} + +class _AvailabilityScreenState extends ConsumerState { + DateTime _selected = DateTime.now(); + + List get _week { + final now = DateTime.now(); + return [for (var i = 0; i < 7; i++) now.add(Duration(days: i))]; + } + + @override + Widget build(BuildContext context) { + final controller = ref.watch(availabilityProvider.notifier); + ref.watch(availabilityProvider); + + final blocks = controller.blocksFor(_selected); + final hours = blocks.fold(0, (sum, b) => sum + b.hours); + final marked = { + for (var i = 0; i < _week.length; i++) + if (controller.blocksFor(_week[i]).isNotEmpty) i, + }; + + return Scaffold( + body: ListView( + padding: EdgeInsets.zero, + children: [ + BrandHeader( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + HeaderIconButton( + icon: LucideIcons.arrowLeft, + onPressed: () => Navigator.of(context).pop(), + ), + const SizedBox(width: 12), + const Expanded( + child: Text( + 'Availability', + style: TextStyle( + fontSize: 25, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + color: Colors.white, + ), + ), + ), + ], + ), + const SizedBox(height: 18), + Wrap( + spacing: 8, + runSpacing: 8, + children: [ + _Preset( + label: 'All week', + onTap: () => + controller.applyPreset(_week, test: (_) => true), + ), + _Preset( + label: 'Weekdays', + onTap: () => controller.applyPreset( + _week, + test: (d) => d.weekday <= DateTime.friday, + ), + ), + _Preset( + label: 'Weekends', + onTap: () => controller.applyPreset( + _week, + test: (d) => d.weekday >= DateTime.saturday, + ), + ), + _Preset( + label: 'Clear', + accent: true, + onTap: () => controller.clearWeek(_week), + ), + ], + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(20, 18, 20, 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + WeekStrip( + days: _week, + selected: _selected, + onSelect: (d) => setState(() => _selected = d), + marked: marked, + ), + const SizedBox(height: 16), + KrowCard( + padding: const EdgeInsets.fromLTRB(16, 14, 16, 16), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + Fmt.dayShort(_selected), + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + letterSpacing: -0.5, + ), + ), + const SizedBox(height: 2), + Text( + blocks.isEmpty + ? 'Marked as a day off' + : 'Available · $hours hrs', + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w500, + color: blocks.isEmpty + ? KrowPalette.mute + : KrowPalette.blue, + ), + ), + ], + ), + ), + Switch( + value: blocks.isNotEmpty, + onChanged: (v) => + controller.setDayAvailable(_selected, v), + ), + ], + ), + const SizedBox(height: 14), + for (final block in DayBlock.values) + Padding( + padding: const EdgeInsets.only(bottom: 9), + child: _BlockRow( + block: block, + on: blocks.contains(block), + onTap: () => + controller.toggleBlock(_selected, block), + ), + ), + ], + ), + ), + const SizedBox(height: 14), + InfoBanner( + blocks.isEmpty + ? 'With every block off, Auto-Match will not send you ' + 'anything on this day.' + : 'Saved. Auto-Match will only offer you shifts inside ' + 'these blocks.', + icon: blocks.isEmpty ? null : LucideIcons.check, + ), + ], + ), + ), + ], + ), + ); + } +} + +class _Preset extends StatelessWidget { + const _Preset({ + required this.label, + required this.onTap, + this.accent = false, + }); + + final String label; + final VoidCallback onTap; + final bool accent; + + @override + Widget build(BuildContext context) { + // Built by hand rather than as a Chip: the app's ChipTheme paints a white + // fill, which would hide white-on-blue header text. + return Material( + color: Colors.white.withValues(alpha: accent ? 0.06 : 0.16), + borderRadius: BorderRadius.circular(9), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(9), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 9), + child: Text( + label, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w600, + color: accent ? KrowPalette.yellow : Colors.white, + ), + ), + ), + ), + ); + } +} + +class _BlockRow extends StatelessWidget { + const _BlockRow({required this.block, required this.on, required this.onTap}); + + final DayBlock block; + final bool on; + final VoidCallback onTap; + + IconData get _icon => switch (block) { + DayBlock.morning => LucideIcons.sunrise, + DayBlock.afternoon => LucideIcons.sun, + DayBlock.evening => LucideIcons.moon, + }; + + @override + Widget build(BuildContext context) { + const duration = Duration(milliseconds: 260); + const curve = Curves.easeOutCubic; + + return GestureDetector( + onTap: onTap, + // Every part of the row animates together, so switching a block on is a + // single motion rather than four things changing at once. + child: AnimatedContainer( + duration: duration, + curve: curve, + padding: const EdgeInsets.all(12), + decoration: BoxDecoration( + color: on ? KrowPalette.blueTint : const Color(0xFFE5F0E8), + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: on + ? KrowPalette.blue.withValues(alpha: 0.3) + : Colors.transparent, + ), + ), + child: Row( + children: [ + AnimatedContainer( + duration: duration, + curve: curve, + width: 38, + height: 38, + decoration: BoxDecoration( + color: on ? KrowPalette.blue : Colors.white, + borderRadius: BorderRadius.circular(11), + border: Border.all( + color: on ? KrowPalette.blue : KrowPalette.line, + ), + ), + child: Icon( + _icon, + size: 18, + color: on ? Colors.white : const Color(0xFF949FA5), + ), + ), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AnimatedDefaultTextStyle( + duration: duration, + curve: curve, + style: TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + color: on ? KrowPalette.ink : KrowPalette.mute, + ), + child: Text(block.label), + ), + AnimatedDefaultTextStyle( + duration: duration, + curve: curve, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w500, + color: on ? KrowPalette.blue : const Color(0xFF949FA5), + ), + child: Text(block.window), + ), + ], + ), + ), + AnimatedContainer( + duration: duration, + curve: curve, + width: 24, + height: 24, + decoration: BoxDecoration( + color: on ? KrowPalette.blue : Colors.transparent, + borderRadius: BorderRadius.circular(7), + border: Border.all( + color: on ? KrowPalette.blue : const Color(0xFFC4D4C9), + width: 1.5, + ), + ), + child: AnimatedScale( + scale: on ? 1 : 0, + duration: duration, + curve: Curves.easeOutBack, + child: const Icon( + LucideIcons.check, + size: 14, + color: Colors.white, + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/clock_screen.dart b/lib/screens/clock_screen.dart new file mode 100644 index 0000000..6b82c8a --- /dev/null +++ b/lib/screens/clock_screen.dart @@ -0,0 +1,397 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/shift.dart'; +import '../state/session_controller.dart'; +import '../state/shifts_controller.dart'; +import '../widgets/collapsing_header.dart'; +import '../widgets/common.dart'; +import '../widgets/shift_card.dart'; + +/// Clock in and out. The button unlocks 30 minutes before the shift starts, +/// and only once the worker is at the venue. +class ClockScreen extends ConsumerStatefulWidget { + const ClockScreen({super.key}); + + @override + ConsumerState createState() => _ClockScreenState(); +} + +class _ClockScreenState extends ConsumerState { + Timer? _ticker; + + /// Stands in for the geofence check while there is no GPS plugin wired up. + bool _atVenue = false; + + /// Last minute we repainted for. Off shift, only the countdown moves, so + /// rebuilding every second would just churn the tree — and a rebuild landing + /// between a tap's down and up swallows it. + int _lastMinute = -1; + + @override + void initState() { + super.initState(); + // Drives the countdown and the running stopwatch. + _ticker = Timer.periodic(const Duration(seconds: 1), (_) { + if (!mounted) return; + final running = ref.read(activeShiftProvider) != null; + final minute = DateTime.now().minute; + if (running || minute != _lastMinute) { + _lastMinute = minute; + setState(() {}); + } + }); + } + + @override + void dispose() { + _ticker?.cancel(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final active = ref.watch(activeShiftProvider); + final next = ref.watch(nextShiftProvider); + final shift = active ?? next; + final locationGranted = ref.watch(sessionProvider).locationGranted; + + return Scaffold( + body: CustomScrollView( + slivers: [ + // Already compact, so it pins at one height rather than collapsing. + // Sized with headroom over the 58px of content, so a larger system + // text scale does not push it over. + KrowSliverHeader( + expandedHeight: 96, + collapsedHeight: 96, + builder: (context, t) => Padding( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 16), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + Fmt.dayFull(DateTime.now()).toUpperCase(), + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.5, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.5), + ), + ), + const SizedBox(height: 4), + const Text( + 'Clock in', + style: TextStyle( + fontSize: 27, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + color: Colors.white, + ), + ), + ], + ), + ), + HeaderIconButton( + icon: LucideIcons.fileText, + tooltip: 'Timecards', + onPressed: () => context.push('/timecards'), + ), + ], + ), + ), + ), + if (shift == null) + const SliverPadding( + padding: EdgeInsets.fromLTRB(20, 40, 20, 20), + sliver: SliverToBoxAdapter( + child: EmptyState( + icon: LucideIcons.clock, + title: 'No shift to clock into', + message: + 'Book a shift and the clock unlocks 30 minutes before ' + 'it starts.', + ), + ), + ) + else + SliverPadding( + padding: const EdgeInsets.fromLTRB(20, 28, 20, 24), + sliver: SliverList.list( + children: [ + _ClockDial(shift: shift, atVenue: _atVenue), + const SizedBox(height: 22), + if (shift.status == ShiftStatus.active) + FilledButton.icon( + onPressed: () => _clockOut(shift), + style: FilledButton.styleFrom( + backgroundColor: KrowPalette.ink, + ), + icon: const Icon(LucideIcons.logOut, size: 18), + label: const Text('Clock out'), + ) + else + FilledButton.icon( + onPressed: _canClockIn(shift, locationGranted) + ? () => _clockIn(shift) + : null, + icon: const Icon(LucideIcons.logIn, size: 18), + label: Text( + _canClockIn(shift, locationGranted) + ? 'Clock in' + : 'Clock in · ${Fmt.untilStart(shift.start)}', + ), + ), + const SizedBox(height: 12), + _GeofenceCard( + shift: shift, + atVenue: _atVenue, + locationGranted: locationGranted, + onChanged: (v) => setState(() => _atVenue = v), + ), + const SectionLabel("Today's shift"), + ShiftCard( + shift: shift, + onTap: () => context.push('/shift/${shift.id}'), + ), + const SizedBox(height: 14), + OutlinedButton.icon( + onPressed: () => context.push('/timecards'), + icon: const Icon(LucideIcons.fileText, size: 18), + label: const Text('View timecards'), + ), + ], + ), + ), + ], + ), + ); + } + + bool _canClockIn(Shift shift, bool locationGranted) { + if (shift.status != ShiftStatus.booked) return false; + if (!_atVenue) return false; + final minutesToStart = shift.start.difference(DateTime.now()).inMinutes; + return minutesToStart <= 30; + } + + void _clockIn(Shift shift) { + // Starting and ending a shift are the two moments that matter most in the + // app; both get a firm confirmation you can feel without looking. + HapticFeedback.mediumImpact(); + ref.read(shiftsProvider.notifier).clockIn(shift.id); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Clocked in at ${Fmt.time(DateTime.now())}')), + ); + } + + Future _clockOut(Shift shift) async { + final confirm = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Clock out?'), + content: Text( + 'Your timecard is filed automatically and sent to ' + '${shift.business} for approval.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('Not yet'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, true), + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Clock out'), + ), + ], + ), + ); + if (confirm != true || !mounted) return; + + HapticFeedback.mediumImpact(); + final card = ref.read(shiftsProvider.notifier).clockOut(shift.id); + if (card == null || !mounted) return; + setState(() => _atVenue = false); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text('Timecard filed · ${Fmt.money(card.amount)}'), + action: SnackBarAction( + label: 'Review', + textColor: KrowPalette.yellow, + onPressed: () => context.push('/timecard/${card.id}'), + ), + ), + ); + } +} + +/// The big circular status dial: a countdown before the shift, a running +/// stopwatch during it. +class _ClockDial extends StatelessWidget { + const _ClockDial({required this.shift, required this.atVenue}); + + final Shift shift; + final bool atVenue; + + @override + Widget build(BuildContext context) { + final running = shift.status == ShiftStatus.active; + final elapsed = running + ? DateTime.now().difference(shift.clockIn!) + : Duration.zero; + final progress = running + ? (elapsed.inSeconds / shift.end.difference(shift.start).inSeconds) + .clamp(0.0, 1.0) + : 0.0; + + return Center( + child: SizedBox( + width: 208, + height: 208, + child: Stack( + alignment: Alignment.center, + children: [ + // The ring fills from zero when the shift starts, and the track + // warms from sage to yellow as it does. + TweenAnimationBuilder( + tween: Tween(end: running ? progress : 0), + duration: const Duration(milliseconds: 700), + curve: Curves.easeOutCubic, + builder: (context, value, _) => SizedBox( + width: 208, + height: 208, + child: CircularProgressIndicator( + value: running ? value : 1, + strokeWidth: 12, + strokeCap: StrokeCap.round, + backgroundColor: const Color(0xFFDEEBE2), + valueColor: AlwaysStoppedAnimation( + running ? KrowPalette.yellow : const Color(0xFFDEEBE2), + ), + ), + ), + ), + AnimatedScale( + // A small swell on clock-in: the dial acknowledges the tap. + scale: running ? 1 : 0.96, + duration: const Duration(milliseconds: 420), + curve: Curves.easeOutBack, + child: Container( + width: 176, + height: 176, + decoration: const BoxDecoration( + color: KrowPalette.blue, + shape: BoxShape.circle, + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AnimatedSwitcher( + duration: const Duration(milliseconds: 300), + // Only the label swaps; the ticking digits must not + // re-animate every second. + child: Text( + running ? Fmt.stopwatch(elapsed) : 'Clock in', + key: ValueKey(running), + style: TextStyle( + fontSize: running ? 27 : 23, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + color: Colors.white, + ), + ), + ), + const SizedBox(height: 6), + Text( + running + ? 'ON SHIFT SINCE ${Fmt.time(shift.clockIn!)}' + : Fmt.untilStart(shift.start).toUpperCase(), + style: const TextStyle( + fontSize: 10, + letterSpacing: 1.3, + fontWeight: FontWeight.w600, + color: KrowPalette.yellow, + ), + ), + ], + ), + ), + ), + ], + ), + ), + ); + } +} + +/// Shows why the clock is locked, and lets the demo simulate arriving on site. +class _GeofenceCard extends StatelessWidget { + const _GeofenceCard({ + required this.shift, + required this.atVenue, + required this.locationGranted, + required this.onChanged, + }); + + final Shift shift; + final bool atVenue; + final bool locationGranted; + final ValueChanged onChanged; + + @override + Widget build(BuildContext context) { + if (shift.status == ShiftStatus.active) { + return InfoBanner( + 'Break of ${shift.breakMinutes} minutes is deducted automatically when ' + 'you clock out.', + ); + } + return KrowCard( + padding: const EdgeInsets.fromLTRB(16, 8, 12, 8), + child: Row( + children: [ + const Icon(LucideIcons.mapPin, size: 18, color: KrowPalette.blue), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + atVenue + ? 'At the venue' + : 'You are ${shift.distanceMiles} mi away', + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + ), + ), + Text( + locationGranted + ? 'Get within 150 m to unlock the button' + : 'Location is off - turn it on in Settings', + style: const TextStyle(fontSize: 12, color: KrowPalette.mute), + ), + ], + ), + ), + Switch(value: atVenue, onChanged: onChanged), + ], + ), + ); + } +} diff --git a/lib/screens/compliance_screens.dart b/lib/screens/compliance_screens.dart new file mode 100644 index 0000000..075b6a8 --- /dev/null +++ b/lib/screens/compliance_screens.dart @@ -0,0 +1,565 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:intl/intl.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; +import '../models/compliance.dart'; +import '../state/compliance_controller.dart'; +import '../widgets/common.dart'; + +IconData _sectionIcon(ComplianceSection s) => switch (s) { + ComplianceSection.documents => LucideIcons.fileText, + ComplianceSection.certificates => LucideIcons.award, + ComplianceSection.taxForms => LucideIcons.receipt, + ComplianceSection.wardrobe => LucideIcons.shirt, +}; + +ChipTone _toneFor(ComplianceState state) => switch (state) { + ComplianceState.verified => ChipTone.neutral, + ComplianceState.pending => ChipTone.blue, + ComplianceState.missing => ChipTone.yellow, +}; + +/// Everything a business must see before you can work. +class ComplianceHubScreen extends ConsumerWidget { + const ComplianceHubScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final (done, total) = ref.watch(complianceProgressProvider); + final remaining = total - done; + + return Scaffold( + body: ListView( + padding: EdgeInsets.zero, + children: [ + BrandHeader( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 22), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + HeaderIconButton( + icon: LucideIcons.arrowLeft, + onPressed: () => context.pop(), + ), + StatusChip( + remaining == 0 ? 'All clear' : '$remaining left', + tone: remaining == 0 ? ChipTone.neutral : ChipTone.yellow, + ), + ], + ), + const SizedBox(height: 18), + const Text( + 'Compliance', + style: TextStyle( + fontSize: 27, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + color: Colors.white, + ), + ), + const SizedBox(height: 5), + Text( + 'Everything a business must see before you work.', + style: TextStyle( + fontSize: 13.5, + color: Colors.white.withValues(alpha: 0.6), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(20, 18, 20, 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + KrowCard( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Overall', + style: TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + ), + ), + Text( + '$done of $total', + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + const SizedBox(height: 11), + KrowProgressBar( + total == 0 ? 1 : done / total, + color: done == total + ? KrowPalette.blue + : KrowPalette.yellow, + ), + ], + ), + ), + const SectionLabel('Sections'), + TileGroup( + children: [ + for (final section in ComplianceSection.values) + Consumer( + builder: (context, ref, _) { + final (d, t) = ref.watch( + sectionProgressProvider(section), + ); + return NavTile( + icon: _sectionIcon(section), + title: section.title, + subtitle: section.subtitle, + badge: StatusChip( + '$d of $t', + tone: d == t ? ChipTone.neutral : ChipTone.yellow, + ), + onTap: () => + context.push('/compliance/${section.name}'), + ); + }, + ), + ], + ), + const SizedBox(height: 16), + const InfoBanner( + 'Documents are shared with a business only when you accept ' + 'one of their shifts.', + ), + ], + ), + ), + ], + ), + ); + } +} + +/// One compliance section: documents, certificates, tax forms or attire. +class ComplianceListScreen extends ConsumerStatefulWidget { + const ComplianceListScreen({super.key, required this.section}); + + final ComplianceSection section; + + @override + ConsumerState createState() => + _ComplianceListScreenState(); +} + +class _ComplianceListScreenState extends ConsumerState { + String _filter = 'All'; + String _query = ''; + + static const _filters = ['All', 'Verified', 'Pending', 'Missing']; + + @override + Widget build(BuildContext context) { + var items = ref.watch(complianceProvider).section(widget.section); + final (done, total) = ref.watch(sectionProgressProvider(widget.section)); + + if (_query.isNotEmpty) { + final q = _query.toLowerCase(); + items = items.where((i) => i.title.toLowerCase().contains(q)).toList(); + } + items = switch (_filter) { + 'Verified' => + items.where((i) => i.state == ComplianceState.verified).toList(), + 'Pending' => + items.where((i) => i.state == ComplianceState.pending).toList(), + 'Missing' => + items.where((i) => i.state == ComplianceState.missing).toList(), + _ => items, + }; + + final required = items.where((i) => i.required_).toList(); + final optional = items.where((i) => !i.required_).toList(); + + return Scaffold( + appBar: AppBar( + title: Text(widget.section.title), + actions: [ + Padding( + padding: const EdgeInsets.only(right: 16), + child: Center( + child: StatusChip( + '$done of $total', + tone: done == total ? ChipTone.neutral : ChipTone.yellow, + ), + ), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + TextField( + onChanged: (v) => setState(() => _query = v), + decoration: InputDecoration( + hintText: 'Search ${widget.section.title.toLowerCase()}', + prefixIcon: const Icon(LucideIcons.search, size: 18), + ), + ), + const SizedBox(height: 14), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + for (final f in _filters) + Padding( + padding: const EdgeInsets.only(right: 8), + child: ChoiceChip( + label: Text(f), + selected: f == _filter, + showCheckmark: false, + selectedColor: KrowPalette.blue, + labelStyle: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w500, + color: f == _filter ? Colors.white : KrowPalette.mute, + ), + onSelected: (_) => setState(() => _filter = f), + ), + ), + ], + ), + ), + if (required.isNotEmpty) ...[ + const SectionLabel('Required'), + TileGroup( + children: [ + for (final item in required) + _ItemTile(section: widget.section, item: item), + ], + ), + ], + if (optional.isNotEmpty) ...[ + const SectionLabel('Unlocks more shifts'), + TileGroup( + children: [ + for (final item in optional) + _ItemTile(section: widget.section, item: item), + ], + ), + ], + if (required.isEmpty && optional.isEmpty) + const Padding( + padding: EdgeInsets.only(top: 24), + child: EmptyState( + icon: LucideIcons.search, + title: 'Nothing here', + message: 'Try a different filter.', + ), + ), + ], + ), + ); + } +} + +class _ItemTile extends StatelessWidget { + const _ItemTile({required this.section, required this.item}); + + final ComplianceSection section; + final ComplianceItem item; + + @override + Widget build(BuildContext context) { + return NavTile( + icon: _sectionIcon(section), + title: item.title, + subtitle: item.subtitle, + badge: StatusChip(item.badge, tone: _toneFor(item.state)), + onTap: () => context.push('/compliance/${section.name}/${item.id}'), + ); + } +} + +/// A single item: the file on record, its expiry, and the actions on it. +class ComplianceDetailScreen extends ConsumerWidget { + const ComplianceDetailScreen({ + super.key, + required this.section, + required this.itemId, + }); + + final ComplianceSection section; + final String itemId; + + Future _upload(BuildContext context, WidgetRef ref) async { + final choice = await showModalBottomSheet( + context: context, + showDragHandle: true, + builder: (context) => SafeArea( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + ListTile( + leading: const Icon(LucideIcons.camera), + title: const Text('Take a photo'), + subtitle: const Text('It has to be the real item, worn by you'), + onTap: () => Navigator.pop(context, 'camera'), + ), + ListTile( + leading: const Icon(LucideIcons.image), + title: const Text('Choose from library'), + onTap: () => Navigator.pop(context, 'library'), + ), + ListTile( + leading: const Icon(LucideIcons.file), + title: const Text('Pick a PDF'), + onTap: () => Navigator.pop(context, 'file'), + ), + ], + ), + ), + ); + if (choice == null || !context.mounted) return; + + final ext = choice == 'file' ? 'pdf' : 'jpg'; + final slug = itemId.toLowerCase(); + ref + .read(complianceProvider.notifier) + .uploadFile(section, itemId, 'krow-$slug.$ext'); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Uploaded - sent for review'))); + } + + Future _remove(BuildContext context, WidgetRef ref) async { + final ok = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Remove this file?'), + content: const Text( + 'Your account goes on hold for anything that needs it until a ' + 'replacement is verified.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('Keep it'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, true), + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Remove'), + ), + ], + ), + ); + if (ok != true || !context.mounted) return; + ref.read(complianceProvider.notifier).removeFile(section, itemId); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('File removed'))); + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + ref.watch(complianceProvider); + final item = ref.read(complianceProvider.notifier).find(section, itemId); + if (item == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('Item not found.')), + ); + } + final d = DateFormat('d MMM yyyy'); + + return Scaffold( + appBar: AppBar( + title: Text(section.title), + actions: [ + Padding( + padding: const EdgeInsets.only(right: 16), + child: Center( + child: StatusChip(item.badge, tone: _toneFor(item.state)), + ), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + Text( + item.title, + style: const TextStyle( + fontSize: 26, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + ), + ), + const SizedBox(height: 6), + Text( + item.subtitle, + style: const TextStyle(fontSize: 13.5, color: KrowPalette.mute), + ), + if (section == ComplianceSection.wardrobe) ...[ + const SizedBox(height: 16), + const InfoBanner( + 'The photo has to be you wearing the item. Catalogue shots and ' + 'images pulled from the web get rejected.', + warning: true, + ), + ], + const SectionLabel('File on record'), + if (item.fileName == null) + EmptyState( + icon: LucideIcons.upload, + title: 'Nothing uploaded', + message: 'JPEG, PNG or PDF, up to 10 MB.', + action: FilledButton.icon( + onPressed: () => _upload(context, ref), + icon: const Icon(LucideIcons.plus, size: 18), + label: const Text('Add a file'), + ), + ) + else + KrowCard( + padding: const EdgeInsets.all(14), + child: Row( + children: [ + Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: const Color(0xFFDEEBE2), + borderRadius: BorderRadius.circular(10), + ), + child: const Icon( + LucideIcons.fileText, + size: 20, + color: Color(0xFF949FA5), + ), + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.fileName!, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(height: 3), + Text( + item.fileMeta ?? '', + style: const TextStyle( + fontSize: 11.5, + color: Color(0xFF949FA5), + ), + ), + ], + ), + ), + IconButton( + onPressed: () => ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Preview opens the file')), + ), + icon: const Icon(LucideIcons.eye, size: 18), + ), + ], + ), + ), + const SectionLabel('Details'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Status', item.badge), + const Divider(height: 1), + _ExpiryRow(section: section, item: item, format: d), + const Divider(height: 1), + const DetailRow('Shared with', '2 businesses'), + ], + ), + ), + const SizedBox(height: 16), + InfoBanner( + item.required_ + ? 'Removing this puts your account on hold until a new file is ' + 'verified. You cannot work in the meantime.' + : 'Optional, but adding it opens up more shifts near you.', + ), + const SizedBox(height: 22), + Row( + children: [ + if (item.fileName != null) ...[ + Expanded( + child: OutlinedButton.icon( + onPressed: () => _remove(context, ref), + icon: const Icon(LucideIcons.trash2, size: 18), + label: const Text('Remove'), + ), + ), + const SizedBox(width: 10), + ], + Expanded( + child: FilledButton.icon( + onPressed: () => _upload(context, ref), + icon: const Icon(LucideIcons.camera, size: 18), + label: Text(item.fileName == null ? 'Upload' : 'Replace'), + ), + ), + ], + ), + ], + ), + ); + } +} + +class _ExpiryRow extends ConsumerWidget { + const _ExpiryRow({ + required this.section, + required this.item, + required this.format, + }); + + final ComplianceSection section; + final ComplianceItem item; + final DateFormat format; + + @override + Widget build(BuildContext context, WidgetRef ref) { + return InkWell( + onTap: () async { + final now = DateTime.now(); + final picked = await showDatePicker( + context: context, + initialDate: item.expires ?? now.add(const Duration(days: 365)), + firstDate: now, + lastDate: DateTime(now.year + 20), + ); + if (picked == null) return; + ref + .read(complianceProvider.notifier) + .setExpiry(section, item.id, picked); + }, + child: DetailRow( + 'Expires', + item.expires == null ? 'Tap to set' : format.format(item.expires!), + valueColor: item.expires == null ? KrowPalette.blue : null, + ), + ); + } +} diff --git a/lib/screens/home_shell.dart b/lib/screens/home_shell.dart new file mode 100644 index 0000000..c7207a7 --- /dev/null +++ b/lib/screens/home_shell.dart @@ -0,0 +1,107 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../state/timecards_controller.dart'; +import '../widgets/krow_nav_bar.dart'; + +/// The five primary tabs. Each keeps its own navigation stack. +class HomeShell extends ConsumerWidget { + const HomeShell({super.key, required this.navigationShell}); + + final StatefulNavigationShell navigationShell; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final needsReview = ref.watch(timecardsNeedingReviewProvider).isNotEmpty; + + return Scaffold( + body: _TabTransition( + index: navigationShell.currentIndex, + child: navigationShell, + ), + bottomNavigationBar: KrowNavBar( + currentIndex: navigationShell.currentIndex, + onSelect: (i) => navigationShell.goBranch( + i, + initialLocation: i == navigationShell.currentIndex, + ), + items: [ + const KrowNavItem(icon: LucideIcons.house, label: 'Today'), + const KrowNavItem(icon: LucideIcons.briefcase, label: 'Shifts'), + KrowNavItem( + icon: LucideIcons.clock, + label: 'Clock', + showDot: needsReview, + ), + const KrowNavItem(icon: LucideIcons.wallet, label: 'Pay'), + const KrowNavItem(icon: LucideIcons.user, label: 'Profile'), + ], + ), + ); + } +} + +/// Fades and lifts the tab content each time the tab changes. +/// +/// Deliberately not an AnimatedSwitcher: that would hold two copies of the +/// shell in the tree at once, and the branch navigators are keyed by +/// GlobalKey, so duplicating them would throw. This keeps one subtree — the +/// branches stay alive and keep their scroll positions — and animates it in +/// place when the index changes. +class _TabTransition extends StatefulWidget { + const _TabTransition({required this.index, required this.child}); + + final int index; + final Widget child; + + @override + State<_TabTransition> createState() => _TabTransitionState(); +} + +class _TabTransitionState extends State<_TabTransition> + with SingleTickerProviderStateMixin { + late final AnimationController _controller = AnimationController( + vsync: this, + duration: const Duration(milliseconds: 260), + value: 1, + ); + + late final Animation _curve = CurvedAnimation( + parent: _controller, + curve: Curves.easeOutCubic, + ); + + @override + void didUpdateWidget(_TabTransition oldWidget) { + super.didUpdateWidget(oldWidget); + if (oldWidget.index != widget.index) _controller.forward(from: 0); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AnimatedBuilder( + animation: _curve, + // The shell is passed through untouched so it is never rebuilt. + child: widget.child, + builder: (context, child) { + final t = _curve.value; + return Opacity( + // Never fully transparent: a tab that blinks out reads as a glitch. + opacity: 0.35 + 0.65 * t, + child: Transform.translate( + offset: Offset(0, (1 - t) * 10), + child: child, + ), + ); + }, + ); + } +} diff --git a/lib/screens/onboarding_screens.dart b/lib/screens/onboarding_screens.dart new file mode 100644 index 0000000..c9a9b9f --- /dev/null +++ b/lib/screens/onboarding_screens.dart @@ -0,0 +1,448 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; +import '../state/session_controller.dart'; + +/// Brand wordmark. Drawn rather than shipped as an asset so it tints cleanly +/// on either ground. +class KrowWordmark extends StatelessWidget { + const KrowWordmark({super.key, this.size = 34, this.color}); + + final double size; + final Color? color; + + @override + Widget build(BuildContext context) { + return Text( + 'KROW', + style: TextStyle( + fontSize: size, + fontWeight: FontWeight.w800, + letterSpacing: size * 0.06, + color: color ?? KrowPalette.yellow, + ), + ); + } +} + +/// Splash. Routes on to onboarding, sign-in or the app depending on how far +/// the worker got last time. +class SplashScreen extends ConsumerStatefulWidget { + const SplashScreen({super.key}); + + @override + ConsumerState createState() => _SplashScreenState(); +} + +class _SplashScreenState extends ConsumerState { + Timer? _timer; + + @override + void initState() { + super.initState(); + _timer = Timer(const Duration(milliseconds: 1400), _go); + } + + @override + void dispose() { + _timer?.cancel(); + super.dispose(); + } + + void _go() { + if (!mounted) return; + final s = ref.read(sessionProvider); + if (!s.onboardingSeen) { + context.go('/onboarding'); + } else if (!s.signedIn) { + context.go('/welcome'); + } else if (!s.permissionsDone) { + context.go('/permissions'); + } else { + context.go('/today'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: KrowPalette.blue, + body: Center( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const KrowWordmark(size: 46), + const SizedBox(height: 22), + Text( + 'WORK · HIRE · ELEVATE', + style: TextStyle( + fontSize: 10.5, + letterSpacing: 3, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.6), + ), + ), + const SizedBox(height: 44), + SizedBox( + width: 140, + child: ClipRRect( + borderRadius: BorderRadius.circular(2), + child: LinearProgressIndicator( + minHeight: 3, + backgroundColor: Colors.white24, + valueColor: const AlwaysStoppedAnimation(KrowPalette.yellow), + ), + ), + ), + ], + ), + ), + ); + } +} + +class _Slide { + const _Slide(this.eyebrow, this.title, this.body, this.icon); + + final String eyebrow; + final String title; + final String body; + final IconData icon; +} + +const _slides = [ + _Slide( + 'Find work', + 'Shifts that fit around your week.', + 'Browse open hospitality shifts near you, filtered to the hours you said ' + 'you can work.', + LucideIcons.search, + ), + _Slide( + 'Know your pay', + 'See the money before you say yes.', + 'Every shift shows the hourly rate and the total. No surprises on the ' + 'payslip.', + LucideIcons.banknote, + ), + _Slide( + 'Get paid', + 'Clock in on site. Paid on schedule.', + 'Tap in when you arrive, tap out when you leave. Timecards submit ' + 'themselves.', + LucideIcons.clock, + ), +]; + +class OnboardingScreen extends ConsumerStatefulWidget { + const OnboardingScreen({super.key}); + + @override + ConsumerState createState() => _OnboardingScreenState(); +} + +class _OnboardingScreenState extends ConsumerState { + final _controller = PageController(); + int _page = 0; + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + void _finish() { + ref.read(sessionProvider.notifier).completeOnboarding(); + context.go('/welcome'); + } + + @override + Widget build(BuildContext context) { + final isLast = _page == _slides.length - 1; + return Scaffold( + backgroundColor: KrowPalette.blue, + body: Column( + children: [ + SafeArea( + bottom: false, + child: Padding( + padding: const EdgeInsets.fromLTRB(22, 8, 12, 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const KrowWordmark(size: 20), + TextButton( + onPressed: _finish, + style: TextButton.styleFrom( + foregroundColor: Colors.white70, + ), + child: const Text('Skip'), + ), + ], + ), + ), + ), + Expanded( + child: PageView.builder( + controller: _controller, + itemCount: _slides.length, + onPageChanged: (i) => setState(() => _page = i), + itemBuilder: (context, i) { + final slide = _slides[i]; + return Center( + child: Container( + width: 190, + height: 190, + decoration: BoxDecoration( + color: Colors.white.withValues(alpha: 0.10), + shape: BoxShape.circle, + ), + child: Icon( + slide.icon, + size: 76, + color: KrowPalette.yellow, + ), + ), + ); + }, + ), + ), + Container( + width: double.infinity, + decoration: const BoxDecoration( + color: KrowPalette.sage, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: SafeArea( + top: false, + child: Padding( + padding: const EdgeInsets.fromLTRB(24, 26, 24, 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + _slides[_page].eyebrow.toUpperCase(), + style: const TextStyle( + fontSize: 10.5, + fontWeight: FontWeight.w600, + letterSpacing: 1.6, + color: Color(0xFF949FA5), + ), + ), + const SizedBox(height: 10), + Text( + _slides[_page].title, + style: const TextStyle( + fontSize: 29, + fontWeight: FontWeight.w700, + height: 1.1, + letterSpacing: -1, + ), + ), + const SizedBox(height: 12), + Text( + _slides[_page].body, + style: const TextStyle( + fontSize: 14.5, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 22), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + for (var i = 0; i < _slides.length; i++) + AnimatedContainer( + duration: const Duration(milliseconds: 220), + margin: const EdgeInsets.symmetric(horizontal: 3), + width: i == _page ? 24 : 6, + height: 6, + decoration: BoxDecoration( + color: i == _page + ? KrowPalette.blue + : const Color(0xFFC6D6CC), + borderRadius: BorderRadius.circular(3), + ), + ), + ], + ), + const SizedBox(height: 18), + FilledButton( + onPressed: () { + if (isLast) { + _finish(); + } else { + _controller.nextPage( + duration: const Duration(milliseconds: 260), + curve: Curves.easeOut, + ); + } + }, + child: Text(isLast ? 'Create your account' : 'Next'), + ), + if (isLast) + Center( + child: TextButton( + onPressed: _finish, + child: const Text('I already have an account'), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + +class WelcomeScreen extends StatelessWidget { + const WelcomeScreen({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: KrowPalette.blue, + body: Column( + children: [ + Expanded( + child: SafeArea( + bottom: false, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 30), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const KrowWordmark(size: 40), + const SizedBox(height: 34), + const Text( + 'Work the shifts\nyou actually want.', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 32, + height: 1.1, + letterSpacing: -1.1, + fontWeight: FontWeight.w700, + color: Colors.white, + ), + ), + const SizedBox(height: 14), + Text( + 'Hospitality work in your city, priced up front and paid ' + 'on a fixed schedule.', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 14.5, + height: 1.55, + color: Colors.white.withValues(alpha: 0.64), + ), + ), + const SizedBox(height: 34), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _WelcomeStat('4,200', 'Shifts this month'), + Container( + width: 1, + height: 38, + margin: const EdgeInsets.symmetric(horizontal: 26), + color: Colors.white24, + ), + _WelcomeStat(r'$21+', 'Average rate'), + ], + ), + ], + ), + ), + ), + ), + Container( + width: double.infinity, + decoration: const BoxDecoration( + color: KrowPalette.sage, + borderRadius: BorderRadius.vertical(top: Radius.circular(24)), + ), + child: SafeArea( + top: false, + child: Padding( + padding: const EdgeInsets.fromLTRB(22, 24, 22, 16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FilledButton( + onPressed: () => context.push('/phone'), + child: const Text('Continue with mobile'), + ), + const SizedBox(height: 10), + OutlinedButton( + onPressed: () => + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text( + 'Invite codes open in the next release', + ), + ), + ), + child: const Text('I have an invite code'), + ), + const SizedBox(height: 12), + const Text( + 'By continuing you accept the Worker Terms.', + style: TextStyle( + fontSize: 11.5, + color: Color(0xFF949FA5), + ), + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + +class _WelcomeStat extends StatelessWidget { + const _WelcomeStat(this.value, this.caption); + + final String value; + final String caption; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Text( + value, + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.w700, + letterSpacing: -0.8, + color: KrowPalette.yellow, + ), + ), + const SizedBox(height: 3), + Text( + caption.toUpperCase(), + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.1, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.55), + ), + ), + ], + ); + } +} diff --git a/lib/screens/pay_screens.dart b/lib/screens/pay_screens.dart new file mode 100644 index 0000000..ca54c00 --- /dev/null +++ b/lib/screens/pay_screens.dart @@ -0,0 +1,620 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:intl/intl.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/shift.dart'; +import '../state/profile_controller.dart'; +import '../state/shifts_controller.dart'; +import '../widgets/collapsing_header.dart'; +import '../widgets/common.dart'; +import '../widgets/glass_segments.dart'; + +enum PayRange { week, month, year, all } + +extension on PayRange { + String get label => switch (this) { + PayRange.week => 'Week', + PayRange.month => 'Month', + PayRange.year => 'Year', + PayRange.all => 'All', + }; + + Duration get window => switch (this) { + PayRange.week => const Duration(days: 7), + PayRange.month => const Duration(days: 30), + PayRange.year => const Duration(days: 365), + PayRange.all => const Duration(days: 3650), + }; +} + +class PayScreen extends ConsumerStatefulWidget { + const PayScreen({super.key}); + + @override + ConsumerState createState() => _PayScreenState(); +} + +class _PayScreenState extends ConsumerState { + PayRange _range = PayRange.month; + + @override + Widget build(BuildContext context) { + final shifts = ref.watch(shiftsProvider); + final cutoff = DateTime.now().subtract(_range.window); + + final completed = shifts + .where( + (s) => s.status == ShiftStatus.completed && s.start.isAfter(cutoff), + ) + .toList(); + final pendingShifts = ref.watch(bookedShiftsProvider); + + final paid = completed.fold(0, (sum, s) => sum + s.pay); + final pending = pendingShifts.fold( + 0, + (sum, s) => sum + s.scheduledPay, + ); + + final segments = GlassSegments( + segments: [for (final r in PayRange.values) (r, r.label)], + value: _range, + onChanged: (r) => setState(() => _range = r), + ); + + return Scaffold( + body: CustomScrollView( + slivers: [ + KrowSliverHeader( + expandedHeight: 168, + // Deep enough to keep the range switcher: collapsing it away would + // mean scrolling back to the top to change what you are looking at. + collapsedHeight: 104, + builder: (context, t) => Padding( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + child: HeaderCrossFade( + t: t, + expandedHeight: 84, + expanded: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'ESTIMATED GROSS PAY · PRE-TAX', + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.5, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.5), + ), + ), + const SizedBox(height: 5), + Text( + Fmt.money(paid + pending), + style: const TextStyle( + fontSize: 40, + fontWeight: FontWeight.w700, + letterSpacing: -1.8, + color: Colors.white, + ), + ), + ], + ), + collapsed: Align( + alignment: Alignment.centerLeft, + child: Text( + '${Fmt.money(paid + pending)} · pre-tax', + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + color: Colors.white, + ), + ), + ), + ), + ), + const SizedBox(height: 12), + segments, + ], + ), + ), + ), + SliverPadding( + padding: const EdgeInsets.fromLTRB(20, 16, 20, 28), + sliver: SliverList.list( + children: [ + KrowCard( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Flexible( + child: Text( + 'EARNINGS TREND', + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 10.5, + fontWeight: FontWeight.w600, + letterSpacing: 1.4, + color: Color(0xFF949FA5), + ), + ), + ), + const SizedBox(width: 8), + Text( + _range.label, + maxLines: 1, + style: const TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w600, + color: Color(0xFF949FA5), + ), + ), + ], + ), + const SizedBox(height: 16), + MiniBarChart(bars: _buildBars(shifts)), + const SizedBox(height: 14), + const Divider(height: 1), + const SizedBox(height: 12), + const Row( + children: [ + LegendDot(KrowPalette.blue, 'Paid'), + SizedBox(width: 16), + LegendDot(KrowPalette.yellow, 'Pending'), + ], + ), + ], + ), + ), + const SizedBox(height: 12), + Row( + children: [ + Expanded( + child: KrowCard( + padding: const EdgeInsets.all(15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const StatusChip('Pending', tone: ChipTone.yellow), + const SizedBox(height: 11), + Text( + Fmt.money(pending), + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + ), + ), + ], + ), + ), + ), + const SizedBox(width: 10), + Expanded( + child: KrowCard( + padding: const EdgeInsets.all(15), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const StatusChip('Paid', tone: ChipTone.neutral), + const SizedBox(height: 11), + Text( + Fmt.money(paid), + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + ), + ), + ], + ), + ), + ), + ], + ), + const SizedBox(height: 12), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.calendarDays, + title: 'Payroll schedule', + subtitle: 'Semi-monthly, 11 days after each period', + onTap: () => context.push('/payroll'), + ), + NavTile( + icon: LucideIcons.landmark, + title: 'Direct deposit', + subtitle: 'Where your pay lands', + badge: ref.watch(profileProvider).bank == null + ? const StatusChip('Add', tone: ChipTone.yellow) + : const StatusChip('Set', tone: ChipTone.neutral), + onTap: () => context.push('/direct-deposit'), + ), + ], + ), + const SectionLabel('Payments'), + if (completed.isEmpty) + const EmptyState( + icon: LucideIcons.banknote, + title: 'Nothing paid yet', + message: 'Finish a shift and the payment shows up here.', + ) + else + for (final shift in completed) + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: _PaymentRow(shift: shift), + ), + const SizedBox(height: 12), + const InfoBanner( + 'Amounts are pre-tax. Your take-home differs after tax, ' + 'deductions and withholding from your payroll provider.', + ), + ], + ), + ), + ], + ), + ); + } + + /// Four buckets across the selected range, split paid vs still pending. + List<(String, double, bool)> _buildBars(List shifts) { + final now = DateTime.now(); + final span = _range.window.inDays; + final bucket = (span / 4).ceil(); + final labels = DateFormat('d MMM'); + + return [ + for (var i = 3; i >= 0; i--) + () { + final end = now.subtract(Duration(days: bucket * i)); + final start = end.subtract(Duration(days: bucket)); + final inBucket = shifts.where( + (s) => s.start.isAfter(start) && !s.start.isAfter(end), + ); + final value = inBucket.fold(0, (sum, s) => sum + s.pay); + final anyPaid = inBucket.any( + (s) => s.status == ShiftStatus.completed, + ); + return (labels.format(end), value, anyPaid); + }(), + ]; + } +} + +class _PaymentRow extends StatelessWidget { + const _PaymentRow({required this.shift}); + + final Shift shift; + + @override + Widget build(BuildContext context) { + return KrowCard( + onTap: () => context.push('/payment/${shift.id}'), + padding: const EdgeInsets.all(14), + child: Row( + children: [ + BusinessBadge(shift.logoLetter, size: 42), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '${shift.role} · ${shift.business}', + style: const TextStyle( + fontSize: 15, + fontWeight: FontWeight.w600, + letterSpacing: -0.3, + ), + ), + const SizedBox(height: 2), + Text( + '${Fmt.dayShort(shift.start)} · ' + '${Fmt.duration(shift.workedDuration ?? shift.scheduledDuration)}', + style: const TextStyle(fontSize: 12, color: KrowPalette.mute), + ), + ], + ), + ), + Text( + Fmt.money(shift.pay), + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + ), + ), + ], + ), + ); + } +} + +/// Semi-monthly periods: each closes on the 15th and the month end, and pays +/// 11 days later. +class PayrollScheduleScreen extends ConsumerWidget { + const PayrollScheduleScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final now = DateTime.now(); + final inFirstHalf = now.day <= 15; + final periodStart = DateTime(now.year, now.month, inFirstHalf ? 1 : 16); + final periodEnd = inFirstHalf + ? DateTime(now.year, now.month, 15) + : DateTime(now.year, now.month + 1, 0); + final payDate = periodEnd.add(const Duration(days: 11)); + + final nextStart = periodEnd.add(const Duration(days: 1)); + final nextEnd = inFirstHalf + ? DateTime(now.year, now.month + 1, 0) + : DateTime(now.year, now.month + 1, 15); + + final elapsed = now.difference(periodStart).inDays + 1; + final total = periodEnd.difference(periodStart).inDays + 1; + final earned = ref.watch(completedEarningsProvider); + final d = DateFormat('d MMM yyyy'); + + return Scaffold( + appBar: AppBar( + title: const Text('Payroll schedule'), + actions: const [ + Padding( + padding: EdgeInsets.only(right: 16), + child: Center( + child: StatusChip('Semi-monthly', tone: ChipTone.yellow), + ), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const Text( + 'Two pay dates a month, 11 days after each period closes.', + style: TextStyle( + fontSize: 13.5, + height: 1.5, + color: KrowPalette.mute, + ), + ), + const SectionLabel('Current period'), + KrowCard( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '${d.format(periodStart)} - ${d.format(periodEnd)}', + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.5, + ), + ), + const StatusChip('Open', tone: ChipTone.yellow), + ], + ), + const SizedBox(height: 4), + Text( + 'Pay date ${d.format(payDate)}', + style: const TextStyle( + fontSize: 12.5, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 13), + KrowProgressBar(elapsed / total), + const SizedBox(height: 9), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '$elapsed of $total days elapsed', + style: const TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w600, + color: Color(0xFF949FA5), + ), + ), + Text( + Fmt.money(earned), + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + ], + ), + ), + const SectionLabel('Next period'), + KrowCard( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + '${d.format(nextStart)} - ${d.format(nextEnd)}', + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.5, + ), + ), + const StatusChip('Not started', tone: ChipTone.muted), + ], + ), + const SizedBox(height: 4), + Text( + 'Pay date ' + '${d.format(nextEnd.add(const Duration(days: 11)))}', + style: const TextStyle( + fontSize: 12.5, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 13), + const KrowProgressBar(0), + ], + ), + ), + const SizedBox(height: 16), + const InfoBanner( + 'Payments generate after the shift scheduled end time, not the ' + 'moment you clock out.', + ), + ], + ), + ); + } +} + +class PaymentDetailScreen extends ConsumerWidget { + const PaymentDetailScreen({super.key, required this.shiftId}); + + final String shiftId; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final shift = ref.watch(shiftsProvider.notifier).byId(shiftId); + if (shift == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('Payment not found.')), + ); + } + final worked = shift.workedDuration ?? shift.scheduledDuration; + + return Scaffold( + body: ListView( + padding: EdgeInsets.zero, + children: [ + BrandHeader( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + HeaderIconButton( + icon: LucideIcons.arrowLeft, + onPressed: () => context.pop(), + ), + const StatusChip('Pending', tone: ChipTone.yellow), + ], + ), + const SizedBox(height: 16), + Text( + 'ESTIMATED GROSS · PRE-TAX', + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.5, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.5), + ), + ), + const SizedBox(height: 4), + Text( + Fmt.money(shift.pay), + style: const TextStyle( + fontSize: 36, + fontWeight: FontWeight.w700, + letterSpacing: -1.6, + color: Colors.white, + ), + ), + const SizedBox(height: 6), + Text( + Fmt.dayShort(shift.start), + style: TextStyle( + fontSize: 12.5, + color: Colors.white.withValues(alpha: 0.62), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(20, 16, 20, 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + StatSlabRow( + slabs: [ + StatSlab( + 'Clock in', + shift.clockIn == null ? '-' : Fmt.time(shift.clockIn!), + ), + StatSlab( + 'Clock out', + shift.clockOut == null ? '-' : Fmt.time(shift.clockOut!), + ), + StatSlab('Hours', Fmt.duration(worked)), + ], + ), + const SectionLabel('Pay breakdown'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Hourly rate', '${Fmt.money(shift.rate)}/hr'), + const Divider(height: 1), + DetailRow( + 'Regular · ${Fmt.duration(worked)}', + Fmt.money(shift.pay), + ), + const Divider(height: 1), + DetailRow('Break, unpaid', '${shift.breakMinutes} min'), + const Divider(height: 1), + DetailRow( + 'Total, pre-tax', + Fmt.money(shift.pay), + emphasis: true, + ), + ], + ), + ), + const SectionLabel('Where'), + KrowCard( + child: Row( + children: [ + const Icon( + LucideIcons.mapPin, + size: 18, + color: KrowPalette.blue, + ), + const SizedBox(width: 12), + Expanded(child: Text(shift.address)), + ], + ), + ), + ], + ), + ), + ], + ), + ); + } +} diff --git a/lib/screens/profile_detail_screens.dart b/lib/screens/profile_detail_screens.dart new file mode 100644 index 0000000..62cae26 --- /dev/null +++ b/lib/screens/profile_detail_screens.dart @@ -0,0 +1,736 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; +import '../models/compliance.dart'; +import '../state/profile_controller.dart'; +import '../state/seed.dart'; +import '../widgets/common.dart'; + +/// Only called if something happens during a shift. Managers never see these. +class EmergencyContactsScreen extends ConsumerWidget { + const EmergencyContactsScreen({super.key}); + + Future _edit( + BuildContext context, + WidgetRef ref, { + EmergencyContact? existing, + int? index, + }) async { + final name = TextEditingController(text: existing?.name ?? ''); + final phone = TextEditingController(text: existing?.phone ?? ''); + var relationship = existing?.relationship ?? 'Spouse'; + + const options = ['Spouse', 'Parent', 'Sibling', 'Child', 'Friend', 'Other']; + + final saved = await showModalBottomSheet( + context: context, + isScrollControlled: true, + showDragHandle: true, + builder: (context) => Padding( + padding: EdgeInsets.only( + left: 20, + right: 20, + bottom: MediaQuery.of(context).viewInsets.bottom + 20, + ), + child: StatefulBuilder( + builder: (context, setSheetState) => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Text( + existing == null ? 'Add a contact' : 'Edit contact', + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.w700, + ), + ), + const SizedBox(height: 16), + TextField( + controller: name, + textCapitalization: TextCapitalization.words, + decoration: const InputDecoration( + labelText: 'Full name', + prefixIcon: Icon(LucideIcons.user, size: 18), + ), + ), + const SizedBox(height: 12), + TextField( + controller: phone, + keyboardType: TextInputType.phone, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp(r'[0-9 +]')), + ], + decoration: const InputDecoration( + labelText: 'Mobile', + prefixIcon: Icon(LucideIcons.phone, size: 18), + ), + ), + const SizedBox(height: 12), + DropdownButtonFormField( + initialValue: relationship, + decoration: const InputDecoration(labelText: 'Relationship'), + items: [ + for (final o in options) + DropdownMenuItem(value: o, child: Text(o)), + ], + onChanged: (v) => + setSheetState(() => relationship = v ?? relationship), + ), + const SizedBox(height: 20), + FilledButton( + onPressed: () => Navigator.pop(context, true), + child: const Text('Save contact'), + ), + const SizedBox(height: 8), + ], + ), + ), + ), + ); + + if (saved != true) return; + if (name.text.trim().isEmpty || phone.text.trim().isEmpty) return; + ref + .read(profileProvider.notifier) + .saveContact( + EmergencyContact( + name: name.text.trim(), + phone: phone.text.trim(), + relationship: relationship, + ), + index: index, + ); + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + final contacts = ref.watch(profileProvider).contacts; + + return Scaffold( + appBar: AppBar(title: const Text('Emergency contacts')), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const Text( + 'We only call these people if something happens to you during a ' + 'shift. Managers never see them.', + style: TextStyle( + fontSize: 13.5, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SectionLabel('Your contacts'), + if (contacts.isEmpty) + const EmptyState( + icon: LucideIcons.phone, + title: 'No contact yet', + message: 'Add at least one before your first shift.', + ) + else + for (var i = 0; i < contacts.length; i++) + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: KrowCard( + onTap: () => + _edit(context, ref, existing: contacts[i], index: i), + padding: const EdgeInsets.all(14), + child: Row( + children: [ + Container( + width: 42, + height: 42, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(12), + ), + child: const Icon( + LucideIcons.user, + size: 19, + color: KrowPalette.blue, + ), + ), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + contacts[i].name, + style: const TextStyle( + fontSize: 15.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.3, + ), + ), + const SizedBox(height: 2), + Text( + '${contacts[i].relationship} · ' + '${contacts[i].phone}', + style: const TextStyle( + fontSize: 12.5, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + IconButton( + onPressed: () => + ref.read(profileProvider.notifier).removeContact(i), + icon: const Icon(LucideIcons.trash2, size: 18), + color: const Color(0xFF949FA5), + ), + ], + ), + ), + ), + const SizedBox(height: 12), + OutlinedButton.icon( + onPressed: () => _edit(context, ref), + icon: const Icon(LucideIcons.plus, size: 18), + label: const Text('Add a contact'), + ), + ], + ), + ); + } +} + +/// More picks mean more shifts offered. +class SkillsScreen extends ConsumerStatefulWidget { + const SkillsScreen({super.key}); + + @override + ConsumerState createState() => _SkillsScreenState(); +} + +class _SkillsScreenState extends ConsumerState { + final _custom = TextEditingController(); + + @override + void dispose() { + _custom.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final profile = ref.watch(profileProvider); + final controller = ref.read(profileProvider.notifier); + final extras = profile.skills.where((s) => !Seed.skills.contains(s)); + + return Scaffold( + appBar: AppBar( + title: const Text('Experience & skills'), + actions: [ + Padding( + padding: const EdgeInsets.only(right: 16), + child: Center( + child: StatusChip( + '${profile.settings.length + profile.skills.length} selected', + tone: ChipTone.yellow, + ), + ), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const Text( + "Where you've worked", + style: TextStyle( + fontSize: 24, + fontWeight: FontWeight.w700, + letterSpacing: -0.8, + ), + ), + const SizedBox(height: 8), + const Text( + 'Pick every setting you have worked in. More picks mean more ' + 'shifts offered.', + style: TextStyle( + fontSize: 13.5, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 18), + Wrap( + spacing: 7, + runSpacing: 7, + children: [ + for (final s in Seed.workSettings) + _Tag( + label: s, + selected: profile.settings.contains(s), + onTap: () => controller.toggleSetting(s), + ), + ], + ), + const SectionLabel('Skills and trades'), + Wrap( + spacing: 7, + runSpacing: 7, + children: [ + for (final s in Seed.skills) + _Tag( + label: s, + selected: profile.skills.contains(s), + onTap: () => controller.toggleSkill(s), + ), + ], + ), + const SectionLabel('Anything else you do'), + Row( + children: [ + Expanded( + child: TextField( + controller: _custom, + textInputAction: TextInputAction.done, + onSubmitted: (v) { + controller.addSkill(v); + _custom.clear(); + }, + decoration: const InputDecoration( + hintText: 'Type a skill...', + ), + ), + ), + const SizedBox(width: 9), + SizedBox( + width: 52, + height: 52, + child: FilledButton( + onPressed: () { + controller.addSkill(_custom.text); + _custom.clear(); + }, + style: FilledButton.styleFrom( + padding: EdgeInsets.zero, + minimumSize: const Size(52, 52), + ), + child: const Icon(LucideIcons.plus, size: 20), + ), + ), + ], + ), + if (extras.isNotEmpty) ...[ + const SizedBox(height: 12), + Wrap( + spacing: 7, + runSpacing: 7, + children: [ + for (final s in extras) + Chip( + label: Text(s), + backgroundColor: KrowPalette.yellow, + side: BorderSide.none, + labelStyle: const TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w600, + color: KrowPalette.ink, + ), + deleteIcon: const Icon(LucideIcons.x, size: 14), + onDeleted: () => controller.toggleSkill(s), + ), + ], + ), + ], + const SizedBox(height: 24), + FilledButton( + onPressed: () { + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Skills saved'))); + Navigator.of(context).pop(); + }, + child: const Text('Save skills'), + ), + ], + ), + ); + } +} + +class _Tag extends StatelessWidget { + const _Tag({ + required this.label, + required this.selected, + required this.onTap, + }); + + final String label; + final bool selected; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return FilterChip( + label: Text(label), + selected: selected, + showCheckmark: false, + onSelected: (_) => onTap(), + selectedColor: KrowPalette.blue, + backgroundColor: Colors.white, + side: BorderSide(color: selected ? KrowPalette.blue : KrowPalette.line), + labelStyle: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w500, + color: selected ? Colors.white : KrowPalette.mute, + ), + ); + } +} + +/// Where your pay lands. Needed before the first pay date. +class DirectDepositScreen extends ConsumerStatefulWidget { + const DirectDepositScreen({super.key}); + + @override + ConsumerState createState() => + _DirectDepositScreenState(); +} + +class _DirectDepositScreenState extends ConsumerState { + final _bank = TextEditingController(); + final _routing = TextEditingController(); + final _account = TextEditingController(); + String _type = 'Chequing'; + bool _editing = false; + + @override + void dispose() { + _bank.dispose(); + _routing.dispose(); + _account.dispose(); + super.dispose(); + } + + void _save() { + if (_bank.text.trim().isEmpty || + _routing.text.length != 9 || + _account.text.length < 4) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar( + content: Text('Check the bank name, 9-digit routing and account'), + ), + ); + return; + } + ref + .read(profileProvider.notifier) + .saveBank( + BankAccount( + bankName: _bank.text.trim(), + routing: _routing.text, + accountLast4: _account.text.substring(_account.text.length - 4), + accountType: _type, + ), + ); + setState(() => _editing = false); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Account saved'))); + } + + @override + Widget build(BuildContext context) { + final bank = ref.watch(profileProvider).bank; + + return Scaffold( + appBar: AppBar(title: const Text('Direct deposit')), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const Text( + 'Where your pay lands. You need this before the first pay date.', + style: TextStyle( + fontSize: 13.5, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 18), + KrowCard( + padding: const EdgeInsets.all(15), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 36, + height: 36, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(10), + ), + child: const Icon( + LucideIcons.shield, + size: 17, + color: KrowPalette.blue, + ), + ), + const SizedBox(width: 12), + const Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'Bank-grade encryption', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + ), + ), + SizedBox(height: 3), + Text( + 'Account numbers are tokenised. KROW staff never see ' + 'them, and neither do the businesses you work for.', + style: TextStyle( + fontSize: 12, + height: 1.45, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + ], + ), + ), + const SectionLabel('Your account'), + if (bank != null && !_editing) + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Bank', bank.bankName), + const Divider(height: 1), + DetailRow('Type', bank.accountType), + const Divider(height: 1), + DetailRow('Routing', bank.routing), + const Divider(height: 1), + DetailRow('Account', '····${bank.accountLast4}'), + ], + ), + ) + else if (!_editing) + EmptyState( + icon: LucideIcons.landmark, + title: 'No account added', + message: 'Add one before the next pay date to get paid on time.', + action: FilledButton.icon( + onPressed: () => setState(() => _editing = true), + icon: const Icon(LucideIcons.plus, size: 18), + label: const Text('Add an account'), + ), + ) + else + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TextField( + controller: _bank, + textCapitalization: TextCapitalization.words, + decoration: const InputDecoration(labelText: 'Bank name'), + ), + const SizedBox(height: 12), + TextField( + controller: _routing, + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + LengthLimitingTextInputFormatter(9), + ], + decoration: const InputDecoration( + labelText: 'Routing number', + helperText: 'Nine digits, on the bottom of a cheque', + ), + ), + const SizedBox(height: 12), + TextField( + controller: _account, + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + LengthLimitingTextInputFormatter(17), + ], + decoration: const InputDecoration( + labelText: 'Account number', + helperText: 'Chequing or savings, in your own name', + ), + ), + const SizedBox(height: 12), + DropdownButtonFormField( + initialValue: _type, + decoration: const InputDecoration(labelText: 'Account type'), + items: const [ + DropdownMenuItem( + value: 'Chequing', + child: Text('Chequing'), + ), + DropdownMenuItem(value: 'Savings', child: Text('Savings')), + ], + onChanged: (v) => setState(() => _type = v ?? _type), + ), + ], + ), + const SizedBox(height: 22), + if (_editing) + Row( + children: [ + Expanded( + child: OutlinedButton( + onPressed: () => setState(() => _editing = false), + child: const Text('Cancel'), + ), + ), + const SizedBox(width: 10), + Expanded( + child: FilledButton( + onPressed: _save, + child: const Text('Save account'), + ), + ), + ], + ) + else if (bank != null) + OutlinedButton( + onPressed: () => setState(() => _editing = true), + child: const Text('Replace account'), + ), + ], + ), + ); + } +} + +/// Policies and balances, per staffing vendor. +class BenefitsScreen extends ConsumerWidget { + const BenefitsScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + // Sick-leave accrual starts after 30 days worked. + const daysWorked = 12; + const threshold = 30; + + return Scaffold( + appBar: AppBar( + title: const Text('Your benefits'), + actions: const [ + Padding( + padding: EdgeInsets.only(right: 16), + child: Center( + child: StatusChip('Legendary Events', tone: ChipTone.yellow), + ), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const Text( + 'Policies and balances, per staffing vendor.', + style: TextStyle(fontSize: 13.5, color: KrowPalette.mute), + ), + const SectionLabel('Active policies'), + Container( + padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 30), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all(color: KrowPalette.line), + ), + child: Column( + children: [ + Container( + width: 56, + height: 56, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: KrowPalette.line), + ), + child: const Icon( + LucideIcons.gift, + size: 24, + color: Color(0xFF949FA5), + ), + ), + const SizedBox(height: 14), + const Text( + 'No policy active yet', + style: TextStyle(fontSize: 18, fontWeight: FontWeight.w700), + ), + const SizedBox(height: 5), + const Text( + 'Sick-leave accrual starts after 30 days worked. ' + 'You are at day $daysWorked.', + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 13, + height: 1.5, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 16), + const Padding( + padding: EdgeInsets.symmetric(horizontal: 24), + child: KrowProgressBar( + daysWorked / threshold, + color: KrowPalette.yellow, + ), + ), + const SizedBox(height: 9), + const Text( + '${threshold - daysWorked} days to go', + style: TextStyle(fontSize: 11.5, color: Color(0xFF949FA5)), + ), + ], + ), + ), + const SectionLabel('Balance history'), + KrowCard( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'A read-only record of accruals, usage, adjustments and ' + 'reversals.', + style: TextStyle( + fontSize: 12.5, + height: 1.5, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 14), + Container( + width: double.infinity, + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: KrowPalette.sage, + borderRadius: BorderRadius.circular(12), + ), + child: const Text( + 'Nothing recorded yet', + textAlign: TextAlign.center, + style: TextStyle(fontSize: 13, color: KrowPalette.mute), + ), + ), + ], + ), + ), + const SizedBox(height: 16), + const InfoBanner( + 'Working for a different vendor? Switch at the top to see their ' + 'policies.', + ), + ], + ), + ); + } +} diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart new file mode 100644 index 0000000..793de96 --- /dev/null +++ b/lib/screens/profile_screen.dart @@ -0,0 +1,362 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; +import '../state/compliance_controller.dart'; +import '../state/profile_controller.dart'; +import '../widgets/collapsing_header.dart'; +import '../widgets/common.dart'; + +class ProfileScreen extends ConsumerWidget { + const ProfileScreen({super.key}); + + /// Avatar (84) + gap + name + role, plus 4/16 padding. + static const _expandedHeader = 192.0; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final worker = ref.watch(workerStatsProvider); + final profile = ref.watch(profileProvider); + final (done, total) = ref.watch(complianceProgressProvider); + + return Scaffold( + body: CustomScrollView( + slivers: [ + KrowSliverHeader( + // Must clear the open content: avatar, name and role, plus the + // padding around them. The settings button overlays rather than + // stacking above, which is what keeps this under 200. + expandedHeight: _expandedHeader, + collapsedHeight: 60, + builder: (context, t) => HeaderCrossFade( + t: t, + expandedHeight: _expandedHeader, + collapsed: Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), + child: Row( + children: [ + Expanded( + child: Text( + worker.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w700, + letterSpacing: -0.5, + color: Colors.white, + ), + ), + ), + HeaderIconButton( + icon: LucideIcons.settings, + tooltip: 'Settings', + onPressed: () => context.push('/settings'), + ), + ], + ), + ), + expanded: Padding( + padding: const EdgeInsets.fromLTRB(20, 12, 20, 16), + child: Stack( + // Without this the unpositioned column would shrink-wrap to + // the Stack's top-left corner instead of centring. + alignment: Alignment.topCenter, + children: [ + // Overlaid rather than stacked above the avatar: as its own + // row it added 46px the header could not afford. + Positioned( + top: 0, + right: 0, + child: HeaderIconButton( + icon: LucideIcons.settings, + tooltip: 'Settings', + onPressed: () => context.push('/settings'), + ), + ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + GestureDetector( + onTap: () => _editName(context, ref, worker.name), + child: Stack( + children: [ + Container( + width: 84, + height: 84, + alignment: Alignment.center, + decoration: const BoxDecoration( + color: KrowPalette.yellow, + shape: BoxShape.circle, + ), + child: Text( + worker.initials, + style: const TextStyle( + fontSize: 28, + fontWeight: FontWeight.w700, + color: KrowPalette.ink, + ), + ), + ), + Positioned( + right: 0, + bottom: 0, + child: Container( + width: 28, + height: 28, + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.circle, + border: Border.all( + color: KrowPalette.blue, + width: 2.5, + ), + ), + child: const Icon( + LucideIcons.pencil, + size: 12, + color: KrowPalette.blue, + ), + ), + ), + ], + ), + ), + const SizedBox(height: 10), + Text( + worker.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 23, + fontWeight: FontWeight.w700, + letterSpacing: -0.8, + color: Colors.white, + ), + ), + const SizedBox(height: 2), + Text( + '${worker.role} · ${worker.city}', + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.5, + letterSpacing: 0.4, + color: Colors.white.withValues(alpha: 0.6), + ), + ), + ], + ), + ], + ), + ), + ), + ), + SliverPadding( + padding: const EdgeInsets.fromLTRB(20, 14, 20, 0), + sliver: SliverList.list( + children: [ + StatRail( + stats: [ + ('Shifts', '${worker.shiftsWorked}'), + ('Rating', worker.rating.toStringAsFixed(1)), + ('On time', '${worker.onTimePercent}%'), + ('No show', '${worker.noShows}'), + ('Cancel', '${worker.cancellations}'), + ], + ), + const SizedBox(height: 11), + KrowCard( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Trust index', + style: TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + ), + ), + Text( + '${worker.trustIndex}%', + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + ), + ), + ], + ), + const SizedBox(height: 11), + KrowProgressBar( + worker.trustIndex / 100, + color: worker.trustIndex < 45 + ? const Color(0xFFA6403F) + : KrowPalette.blue, + ), + const SizedBox(height: 9), + const Text( + 'Stay above 45% to keep picking up shifts. On-time ' + 'arrivals raise it fastest.', + style: TextStyle( + fontSize: 12, + height: 1.45, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + const SectionLabel('Compliance'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.shieldCheck, + title: 'Compliance hub', + subtitle: 'Everything a business must see', + badge: StatusChip( + '$done of $total', + tone: done == total + ? ChipTone.neutral + : ChipTone.yellow, + ), + onTap: () => context.push('/compliance'), + ), + ], + ), + const SectionLabel('Your details'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.user, + title: 'Personal info', + subtitle: worker.phone, + onTap: () => _editName(context, ref, worker.name), + ), + NavTile( + icon: LucideIcons.phone, + title: 'Emergency contact', + subtitle: 'Who we call if something happens', + badge: StatusChip( + '${profile.contacts.length}', + tone: ChipTone.neutral, + ), + onTap: () => context.push('/emergency-contacts'), + ), + NavTile( + icon: LucideIcons.briefcase, + title: 'Experience & skills', + subtitle: 'Work history and trades', + badge: StatusChip( + '${profile.skills.length}', + tone: ChipTone.neutral, + ), + onTap: () => context.push('/skills'), + ), + NavTile( + icon: LucideIcons.calendar, + title: 'Availability', + subtitle: 'The hours you can work', + onTap: () => context.push('/availability'), + ), + NavTile( + icon: LucideIcons.gift, + title: 'Benefits', + subtitle: 'Policies and balance history', + onTap: () => context.push('/benefits'), + ), + ], + ), + const SectionLabel('Money'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.landmark, + title: 'Direct deposit', + subtitle: profile.bank == null + ? 'Not set up yet' + : '${profile.bank!.bankName} ' + '····${profile.bank!.accountLast4}', + badge: profile.bank == null + ? const StatusChip('Add', tone: ChipTone.yellow) + : null, + onTap: () => context.push('/direct-deposit'), + ), + NavTile( + icon: LucideIcons.fileText, + title: 'Timecards', + subtitle: 'Hours worked and disputes', + onTap: () => context.push('/timecards'), + ), + ], + ), + const SectionLabel('Support'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.lifeBuoy, + title: 'Contact support', + subtitle: 'Usually answered within 4 hours', + onTap: () => context.push('/support'), + ), + NavTile( + icon: LucideIcons.circleHelp, + title: 'FAQs', + subtitle: 'Common questions answered', + onTap: () => context.push('/faqs'), + ), + NavTile( + icon: LucideIcons.shield, + title: 'Privacy & security', + subtitle: 'Account and data settings', + onTap: () => context.push('/privacy'), + ), + ], + ), + const SizedBox(height: 28), + ], + ), + ), + ], + ), + ); + } + + Future _editName( + BuildContext context, + WidgetRef ref, + String current, + ) async { + final controller = TextEditingController(text: current); + final name = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Your name'), + content: TextField( + controller: controller, + autofocus: true, + textCapitalization: TextCapitalization.words, + decoration: const InputDecoration(hintText: 'Full name'), + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Cancel'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, controller.text.trim()), + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Save'), + ), + ], + ), + ); + if (name == null || name.isEmpty) return; + ref.read(profileProvider.notifier).updateName(name); + } +} diff --git a/lib/screens/settings_screens.dart b/lib/screens/settings_screens.dart new file mode 100644 index 0000000..c7b48c7 --- /dev/null +++ b/lib/screens/settings_screens.dart @@ -0,0 +1,589 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; +import '../state/profile_controller.dart'; +import '../state/seed.dart'; +import '../state/session_controller.dart'; +import '../state/shifts_controller.dart'; +import '../state/timecards_controller.dart'; +import '../widgets/common.dart'; + +class SettingsScreen extends ConsumerWidget { + const SettingsScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final session = ref.watch(sessionProvider); + final notifier = ref.read(sessionProvider.notifier); + final profile = ref.watch(profileProvider); + final reviewCount = ref.watch(timecardsNeedingReviewProvider).length; + + return Scaffold( + appBar: AppBar( + title: const Text('Settings'), + actions: const [ + Padding( + padding: EdgeInsets.only(right: 16), + child: Center(child: StatusChip('v1.1.1', tone: ChipTone.yellow)), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const SectionLabel('Permissions'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + _SwitchRow( + icon: LucideIcons.mapPin, + title: 'Location', + subtitle: 'Needed to clock in at the venue', + value: session.locationGranted, + onChanged: (v) => v ? notifier.grantLocation() : null, + ), + const Divider(height: 1), + _SwitchRow( + icon: LucideIcons.bell, + title: 'Notifications', + subtitle: 'Shift offers, reminders and pay alerts', + value: session.notificationsGranted, + onChanged: (v) => v ? notifier.grantNotifications() : null, + ), + const Divider(height: 1), + _SwitchRow( + icon: LucideIcons.camera, + title: 'Camera', + subtitle: 'Photograph documents and attire', + value: session.cameraGranted, + onChanged: (v) => v ? notifier.grantCamera() : null, + ), + ], + ), + ), + const SectionLabel('Money'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.landmark, + title: 'Direct deposit', + subtitle: profile.bank == null + ? 'Where your pay lands' + : profile.bank!.bankName, + badge: profile.bank == null + ? const StatusChip('Add', tone: ChipTone.yellow) + : null, + onTap: () => context.push('/direct-deposit'), + ), + NavTile( + icon: LucideIcons.clock, + title: 'Timecards', + subtitle: 'Hours worked and disputes', + badge: reviewCount > 0 + ? StatusChip('$reviewCount', tone: ChipTone.yellow) + : null, + onTap: () => context.push('/timecards'), + ), + NavTile( + icon: LucideIcons.calendarDays, + title: 'Payroll schedule', + subtitle: 'When each period closes and pays', + onTap: () => context.push('/payroll'), + ), + ], + ), + const SectionLabel('Support'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.lifeBuoy, + title: 'Contact support', + subtitle: 'Usually answered within 4 hours', + onTap: () => context.push('/support'), + ), + NavTile( + icon: LucideIcons.circleHelp, + title: 'FAQs', + subtitle: 'Common questions answered', + onTap: () => context.push('/faqs'), + ), + NavTile( + icon: LucideIcons.shield, + title: 'Privacy & security', + subtitle: 'Account and data settings', + onTap: () => context.push('/privacy'), + ), + ], + ), + const SizedBox(height: 22), + OutlinedButton.icon( + onPressed: () => _signOut(context, ref), + icon: const Icon(LucideIcons.logOut, size: 18), + label: const Text('Sign out'), + ), + const SizedBox(height: 22), + const Center( + child: Text( + 'VERSION 1.1.1 · BUILD 26', + style: TextStyle( + fontSize: 11, + letterSpacing: 1.2, + color: Color(0xFF949FA5), + ), + ), + ), + ], + ), + ); + } + + Future _signOut(BuildContext context, WidgetRef ref) async { + final ok = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Sign out?'), + content: const Text('You will need to verify your number again.'), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('Stay'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, true), + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Sign out'), + ), + ], + ), + ); + if (ok != true || !context.mounted) return; + await ref.read(sessionProvider.notifier).signOut(); + if (!context.mounted) return; + context.go('/welcome'); + } +} + +class _SwitchRow extends StatelessWidget { + const _SwitchRow({ + required this.icon, + required this.title, + required this.subtitle, + required this.value, + required this.onChanged, + }); + + final IconData icon; + final String title; + final String subtitle; + final bool value; + final ValueChanged onChanged; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(11), + ), + child: Icon(icon, size: 18, color: KrowPalette.blue), + ), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + ), + ), + Text( + subtitle, + style: const TextStyle(fontSize: 12, color: KrowPalette.mute), + ), + ], + ), + ), + Switch(value: value, onChanged: onChanged), + ], + ), + ); + } +} + +/// Pick what it is about so it reaches the right person first time. +class SupportScreen extends ConsumerStatefulWidget { + const SupportScreen({super.key}); + + @override + ConsumerState createState() => _SupportScreenState(); +} + +class _SupportScreenState extends ConsumerState { + String _topic = Seed.supportTopics.first; + String? _shiftId; + final _message = TextEditingController(); + + @override + void dispose() { + _message.dispose(); + super.dispose(); + } + + void _send() { + if (_message.text.trim().length < 10) { + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Tell us a little more than that')), + ); + return; + } + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('Sent to support · $_topic'))); + Navigator.of(context).pop(); + } + + @override + Widget build(BuildContext context) { + final shifts = ref.watch(shiftsProvider); + + return Scaffold( + appBar: AppBar( + title: const Text('Get help'), + actions: const [ + Padding( + padding: EdgeInsets.only(right: 16), + child: Center(child: StatusChip('~4 hr reply')), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const Text( + 'Pick what it is about so it reaches the right person first time.', + style: TextStyle( + fontSize: 13.5, + height: 1.55, + color: KrowPalette.mute, + ), + ), + const SectionLabel("What's it about?"), + Wrap( + spacing: 7, + runSpacing: 7, + children: [ + for (final t in Seed.supportTopics) + ChoiceChip( + label: Text(t), + selected: t == _topic, + showCheckmark: false, + selectedColor: KrowPalette.blue, + labelStyle: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w500, + color: t == _topic ? Colors.white : KrowPalette.mute, + ), + onSelected: (_) => setState(() => _topic = t), + ), + ], + ), + const SectionLabel('Which shift?'), + DropdownButtonFormField( + initialValue: _shiftId, + isExpanded: true, + decoration: const InputDecoration( + hintText: 'Not about a specific shift', + ), + items: [ + for (final s in shifts) + DropdownMenuItem( + value: s.id, + child: Text( + '${s.role} · ${s.business}', + overflow: TextOverflow.ellipsis, + ), + ), + ], + onChanged: (v) => setState(() => _shiftId = v), + ), + const SectionLabel('Tell us what happened'), + TextField( + controller: _message, + maxLines: 5, + maxLength: 500, + decoration: const InputDecoration( + hintText: 'The venue door was locked when I arrived...', + ), + ), + TextButton.icon( + onPressed: () => ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Attachments open the camera roll')), + ), + icon: const Icon(LucideIcons.paperclip, size: 16), + label: const Text('Attach a photo'), + ), + const SizedBox(height: 16), + FilledButton(onPressed: _send, child: const Text('Send to support')), + ], + ), + ); + } +} + +class FaqScreen extends StatefulWidget { + const FaqScreen({super.key}); + + @override + State createState() => _FaqScreenState(); +} + +class _FaqScreenState extends State { + String _query = ''; + + @override + Widget build(BuildContext context) { + final q = _query.toLowerCase(); + + return Scaffold( + appBar: AppBar(title: const Text('Questions')), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + TextField( + onChanged: (v) => setState(() => _query = v), + decoration: const InputDecoration( + hintText: 'Search help', + prefixIcon: Icon(LucideIcons.search, size: 18), + ), + ), + for (final entry in Seed.faqs.entries) + () { + final matches = entry.value + .where( + (f) => + q.isEmpty || + f.$1.toLowerCase().contains(q) || + f.$2.toLowerCase().contains(q), + ) + .toList(); + if (matches.isEmpty) return const SizedBox.shrink(); + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + SectionLabel(entry.key), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: Column( + children: [ + for (var i = 0; i < matches.length; i++) ...[ + if (i > 0) const Divider(height: 1), + ExpansionTile( + shape: const Border(), + collapsedShape: const Border(), + tilePadding: const EdgeInsets.symmetric( + horizontal: 12, + ), + childrenPadding: const EdgeInsets.fromLTRB( + 12, + 0, + 12, + 14, + ), + title: Text( + matches[i].$1, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + ), + ), + children: [ + Align( + alignment: Alignment.centerLeft, + child: Text( + matches[i].$2, + style: const TextStyle( + fontSize: 13, + height: 1.55, + color: KrowPalette.mute, + ), + ), + ), + ], + ), + ], + ], + ), + ), + ], + ); + }(), + ], + ), + ); + } +} + +class PrivacyScreen extends ConsumerWidget { + const PrivacyScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final profile = ref.watch(profileProvider); + + return Scaffold( + appBar: AppBar(title: const Text('Privacy & security')), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + const SectionLabel('Legal'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.fileText, + title: 'Terms of service', + subtitle: 'Updated 14 Jun 2026', + onTap: () => _open(context, 'Terms of service'), + ), + NavTile( + icon: LucideIcons.shield, + title: 'Privacy policy', + subtitle: 'What we collect and why', + onTap: () => _open(context, 'Privacy policy'), + ), + ], + ), + const SectionLabel('Who sees your data'), + TileGroup( + children: [ + NavTile( + icon: LucideIcons.briefcase, + title: "Businesses you've worked for", + subtitle: '2 have access to your documents', + onTap: () => _open(context, 'Data sharing'), + ), + ], + ), + const SectionLabel('Email'), + KrowCard( + padding: const EdgeInsets.fromLTRB(16, 8, 8, 8), + child: Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(11), + ), + child: const Icon( + LucideIcons.mail, + size: 18, + color: KrowPalette.blue, + ), + ), + const SizedBox(width: 13), + const Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'KROW newsletter', + style: TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + ), + ), + Text( + 'Product news and operational tips', + style: TextStyle(fontSize: 12, color: KrowPalette.mute), + ), + ], + ), + ), + Switch( + value: profile.newsletter, + onChanged: (v) => + ref.read(profileProvider.notifier).setNewsletter(v), + ), + ], + ), + ), + const SectionLabel('Account'), + KrowCard( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Text( + 'Delete your account', + style: TextStyle(fontSize: 14.5, fontWeight: FontWeight.w600), + ), + const SizedBox(height: 3), + const Text( + 'Permanent. Timecards and tax records are kept for 4 years ' + 'by law, then destroyed.', + style: TextStyle( + fontSize: 12, + height: 1.45, + color: KrowPalette.mute, + ), + ), + const SizedBox(height: 14), + OutlinedButton.icon( + onPressed: () => _confirmDelete(context), + icon: const Icon(LucideIcons.trash2, size: 18), + label: const Text('Delete account'), + ), + ], + ), + ), + ], + ), + ); + } + + void _open(BuildContext context, String title) { + ScaffoldMessenger.of( + context, + ).showSnackBar(SnackBar(content: Text('$title opens in the browser'))); + } + + Future _confirmDelete(BuildContext context) async { + await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Delete your account?'), + content: const Text( + 'This cannot be undone. To go ahead, contact support so we can ' + 'confirm it is really you.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Keep my account'), + ), + FilledButton( + onPressed: () { + Navigator.pop(context); + context.push('/support'); + }, + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Contact support'), + ), + ], + ), + ); + } +} diff --git a/lib/screens/shift_detail_screen.dart b/lib/screens/shift_detail_screen.dart new file mode 100644 index 0000000..3e925a4 --- /dev/null +++ b/lib/screens/shift_detail_screen.dart @@ -0,0 +1,379 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/compliance.dart'; +import '../models/shift.dart'; +import '../state/compliance_controller.dart'; +import '../state/shifts_controller.dart'; +import '../widgets/common.dart'; + +class ShiftDetailScreen extends ConsumerWidget { + const ShiftDetailScreen({super.key, required this.shiftId}); + + final String shiftId; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final shift = ref.watch(shiftsProvider.notifier).byId(shiftId); + if (shift == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('That shift is no longer listed.')), + ); + } + + return Scaffold( + body: ListView( + padding: EdgeInsets.zero, + children: [ + BrandHeader( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 24), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + HeaderIconButton( + icon: LucideIcons.arrowLeft, + onPressed: () => context.pop(), + ), + HeaderIconButton( + icon: LucideIcons.messageCircle, + tooltip: 'Message the manager', + onPressed: () => context.push('/support'), + ), + ], + ), + const SizedBox(height: 18), + StatusChip( + shift.status.label, + tone: switch (shift.status) { + ShiftStatus.active || ShiftStatus.booked => ChipTone.yellow, + ShiftStatus.noShow => ChipTone.danger, + _ => ChipTone.neutral, + }, + ), + const SizedBox(height: 12), + Text( + shift.role, + style: const TextStyle( + fontSize: 30, + fontWeight: FontWeight.w700, + letterSpacing: -1.1, + color: Colors.white, + ), + ), + const SizedBox(height: 4), + Text( + '${shift.business} · ${Fmt.dayShort(shift.start)}', + style: TextStyle( + fontSize: 14, + color: Colors.white.withValues(alpha: 0.62), + ), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.fromLTRB(20, 16, 20, 28), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + StatSlabRow( + slabs: [ + StatSlab( + shift.status == ShiftStatus.completed ? 'Paid' : 'Est.', + Fmt.money(shift.pay), + ), + StatSlab('Rate', '${Fmt.money(shift.rate)}/hr'), + StatSlab( + 'Hours', + Fmt.duration( + shift.workedDuration ?? shift.scheduledDuration, + ), + ), + ], + ), + const SectionLabel('The shift'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Date', Fmt.dayShort(shift.start)), + const Divider(height: 1), + DetailRow( + 'Scheduled', + Fmt.window(shift.start, shift.end), + ), + const Divider(height: 1), + DetailRow('Location', shift.address), + const Divider(height: 1), + DetailRow('Break, unpaid', '${shift.breakMinutes} min'), + if (shift.manager != null) ...[ + const Divider(height: 1), + DetailRow('Report to', shift.manager!), + ], + if (shift.clockIn != null) ...[ + const Divider(height: 1), + DetailRow( + 'Clocked', + shift.clockOut == null + ? '${Fmt.time(shift.clockIn!)} - running' + : Fmt.window(shift.clockIn!, shift.clockOut!), + valueColor: KrowPalette.blue, + ), + ], + ], + ), + ), + const SectionLabel('Pay breakdown'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Base rate', '${Fmt.money(shift.rate)}/hr'), + const Divider(height: 1), + DetailRow( + 'Regular · ' + '${Fmt.duration(shift.workedDuration ?? shift.scheduledDuration)}', + Fmt.money(shift.pay), + ), + const Divider(height: 1), + DetailRow( + 'Total, pre-tax', + Fmt.money(shift.pay), + emphasis: true, + ), + ], + ), + ), + const SectionLabel('Requirements'), + _Requirements(shift: shift), + const SizedBox(height: 18), + _Actions(shift: shift), + ], + ), + ), + ], + ), + ); + } +} + +/// What this business asks for, checked against what is already on file. +class _Requirements extends ConsumerWidget { + const _Requirements({required this.shift}); + + final Shift shift; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final held = ref.watch(complianceProvider).all; + var met = 0; + final rows = []; + + for (final req in shift.requirements) { + final item = held.where((i) => i.title == req).firstOrNull; + final ok = item?.state == ComplianceState.verified; + if (ok) met++; + rows.add( + Padding( + padding: const EdgeInsets.symmetric(vertical: 11), + child: Row( + children: [ + Container( + width: 22, + height: 22, + decoration: BoxDecoration( + color: ok ? KrowPalette.blueTint : const Color(0xFFF7E4AE), + borderRadius: BorderRadius.circular(7), + ), + child: Icon( + ok ? LucideIcons.check : LucideIcons.clock, + size: 12, + color: ok ? KrowPalette.blue : KrowPalette.ink, + ), + ), + const SizedBox(width: 12), + Expanded( + child: Text( + req, + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.w600, + ), + ), + ), + Text( + ok ? 'On file' : (item?.badge ?? 'Missing'), + style: TextStyle( + fontSize: 12, + color: ok ? KrowPalette.mute : KrowPalette.ink, + fontWeight: ok ? FontWeight.w400 : FontWeight.w600, + ), + ), + ], + ), + ), + ); + } + + final total = shift.requirements.length; + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + KrowCard( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + SizedBox( + width: 54, + height: 54, + child: Stack( + alignment: Alignment.center, + children: [ + CircularProgressIndicator( + value: total == 0 ? 1 : met / total, + strokeWidth: 6, + backgroundColor: const Color(0xFFDEEBE2), + valueColor: const AlwaysStoppedAnimation( + KrowPalette.blue, + ), + ), + Text( + '$met/$total', + style: const TextStyle( + fontSize: 12, + fontWeight: FontWeight.w700, + color: KrowPalette.blue, + ), + ), + ], + ), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + met == total + ? 'You are cleared to work' + : 'Some items still missing', + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + const SizedBox(height: 4), + Text( + met == total + ? 'Everything ${shift.business} asks for is on file.' + : 'Clear them from the compliance hub to apply.', + style: const TextStyle( + fontSize: 13, + height: 1.45, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + ], + ), + ), + const SizedBox(height: 10), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4), + child: Column(children: rows), + ), + ], + ); + } +} + +class _Actions extends ConsumerWidget { + const _Actions({required this.shift}); + + final Shift shift; + + Future _confirmCancel(BuildContext context, WidgetRef ref) async { + final ok = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Give this shift back?'), + content: const Text( + 'It goes back on the open market straight away, and the ' + 'cancellation counts against your trust index.', + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context, false), + child: const Text('Keep it'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, true), + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Cancel shift'), + ), + ], + ), + ); + if (ok != true || !context.mounted) return; + ref.read(shiftsProvider.notifier).cancel(shift.id); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Shift cancelled'))); + context.pop(); + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + switch (shift.status) { + case ShiftStatus.open: + return FilledButton.icon( + onPressed: () { + ref.read(shiftsProvider.notifier).apply(shift.id); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Shift booked'))); + }, + icon: const Icon(LucideIcons.check, size: 18), + label: const Text('Apply for this shift'), + ); + case ShiftStatus.booked: + return Column( + children: [ + FilledButton.icon( + onPressed: () => context.go('/clock'), + icon: const Icon(LucideIcons.clock, size: 18), + label: const Text('Go to clock in'), + ), + const SizedBox(height: 10), + OutlinedButton( + onPressed: () => _confirmCancel(context, ref), + child: const Text('Cancel this shift'), + ), + ], + ); + case ShiftStatus.active: + return FilledButton.icon( + onPressed: () => context.go('/clock'), + icon: const Icon(LucideIcons.squareCheck, size: 18), + label: const Text('You are on shift - clock out'), + ); + default: + return OutlinedButton.icon( + onPressed: () => context.push('/support'), + icon: const Icon(LucideIcons.lifeBuoy, size: 18), + label: const Text('Something wrong? Get help'), + ); + } + } +} diff --git a/lib/screens/shifts_screen.dart b/lib/screens/shifts_screen.dart new file mode 100644 index 0000000..eb16c28 --- /dev/null +++ b/lib/screens/shifts_screen.dart @@ -0,0 +1,396 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/shift.dart'; +import '../state/shifts_controller.dart'; +import '../widgets/common.dart'; +import '../widgets/glass_segments.dart'; +import '../widgets/shift_card.dart'; +import '../widgets/week_strip.dart'; + +enum _Tab { booked, open, history } + +class ShiftsScreen extends ConsumerStatefulWidget { + const ShiftsScreen({super.key}); + + @override + ConsumerState createState() => _ShiftsScreenState(); +} + +class _ShiftsScreenState extends ConsumerState { + _Tab _tab = _Tab.booked; + + /// Where we came from, so the new list can slide in from the right side. + _Tab _previousTab = _Tab.booked; + DateTime _selectedDay = DateTime.now(); + String _query = ''; + String _filter = 'All'; + + void _selectTab(_Tab tab) { + if (tab == _tab) return; + setState(() { + _previousTab = _tab; + _tab = tab; + }); + } + + List get _week { + final now = DateTime.now(); + return [for (var i = 0; i < 7; i++) now.add(Duration(days: i))]; + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Column( + children: [ + BrandHeader( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + Fmt.monthYear(DateTime.now()).toUpperCase(), + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.6, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.5), + ), + ), + const SizedBox(height: 4), + const Text( + 'Shifts', + style: TextStyle( + fontSize: 27, + fontWeight: FontWeight.w700, + letterSpacing: -0.9, + color: Colors.white, + ), + ), + const SizedBox(height: 18), + _HeaderSegments(value: _tab, onChanged: _selectTab), + ], + ), + ), + Expanded( + // The list slides in from the side the new tab sits on, so the + // content moves the same way your eye just did. + child: AnimatedSwitcher( + duration: const Duration(milliseconds: 280), + switchInCurve: Curves.easeOutCubic, + switchOutCurve: Curves.easeIn, + layoutBuilder: (current, previous) => Stack( + alignment: Alignment.topCenter, + children: [...previous, ?current], + ), + transitionBuilder: (child, animation) { + final incoming = child.key == ValueKey(_tab); + final direction = _tab.index >= _previousTab.index ? 1.0 : -1.0; + return FadeTransition( + opacity: animation, + child: SlideTransition( + position: Tween( + begin: Offset(incoming ? 0.08 * direction : 0, 0), + end: Offset.zero, + ).animate(animation), + child: child, + ), + ); + }, + child: KeyedSubtree( + key: ValueKey(_tab), + child: switch (_tab) { + _Tab.booked => _BookedTab( + week: _week, + selected: _selectedDay, + onSelect: (d) => setState(() => _selectedDay = d), + ), + _Tab.open => _OpenTab( + query: _query, + filter: _filter, + onQuery: (q) => setState(() => _query = q), + onFilter: (f) => setState(() => _filter = f), + ), + _Tab.history => const _HistoryTab(), + }, + ), + ), + ), + ], + ), + ); + } +} + +class _HeaderSegments extends StatelessWidget { + const _HeaderSegments({required this.value, required this.onChanged}); + + final _Tab value; + final ValueChanged<_Tab> onChanged; + + @override + Widget build(BuildContext context) { + return GlassSegments<_Tab>( + segments: const [ + (_Tab.booked, 'Booked'), + (_Tab.open, 'Open'), + (_Tab.history, 'History'), + ], + value: value, + onChanged: onChanged, + ); + } +} + +class _BookedTab extends ConsumerWidget { + const _BookedTab({ + required this.week, + required this.selected, + required this.onSelect, + }); + + final List week; + final DateTime selected; + final ValueChanged onSelect; + + @override + Widget build(BuildContext context, WidgetRef ref) { + final booked = ref.watch(bookedShiftsProvider); + final forDay = booked.where((s) => Fmt.sameDay(s.start, selected)).toList(); + final marked = { + for (var i = 0; i < week.length; i++) + if (booked.any((s) => Fmt.sameDay(s.start, week[i]))) i, + }; + + return ListView( + padding: const EdgeInsets.fromLTRB(20, 18, 20, 24), + children: [ + WeekStrip( + days: week, + selected: selected, + onSelect: onSelect, + marked: marked, + ), + SectionLabel( + '${Fmt.dayFull(selected)} · ${forDay.length} ' + '${forDay.length == 1 ? 'shift' : 'shifts'}', + ), + if (forDay.isEmpty) + const EmptyState( + icon: LucideIcons.ticket, + title: 'Nothing booked this day', + message: 'Switch to Open above to claim a shift near you.', + ) + else + for (final shift in forDay) + Padding( + padding: const EdgeInsets.only(bottom: 11), + child: ShiftCard( + shift: shift, + onTap: () => context.push('/shift/${shift.id}'), + ), + ), + const SizedBox(height: 6), + const InfoBanner( + 'Auto-Match only offers you shifts inside the availability blocks you ' + 'have switched on.', + ), + ], + ); + } +} + +class _OpenTab extends ConsumerWidget { + const _OpenTab({ + required this.query, + required this.filter, + required this.onQuery, + required this.onFilter, + }); + + final String query; + final String filter; + final ValueChanged onQuery; + final ValueChanged onFilter; + + static const _filters = ['All', 'Today', 'This week', 'Top pay']; + + @override + Widget build(BuildContext context, WidgetRef ref) { + var shifts = ref.watch(openShiftsProvider); + final now = DateTime.now(); + + if (query.isNotEmpty) { + final q = query.toLowerCase(); + shifts = shifts + .where( + (s) => + s.role.toLowerCase().contains(q) || + s.business.toLowerCase().contains(q) || + s.venue.toLowerCase().contains(q), + ) + .toList(); + } + shifts = switch (filter) { + 'Today' => shifts.where((s) => Fmt.sameDay(s.start, now)).toList(), + 'This week' => + shifts.where((s) => s.start.difference(now).inDays < 7).toList(), + 'Top pay' => shifts.where((s) => s.rate >= 22).toList(), + _ => shifts, + }; + + return ListView( + padding: const EdgeInsets.fromLTRB(20, 18, 20, 24), + children: [ + TextField( + onChanged: onQuery, + decoration: const InputDecoration( + hintText: 'Role, business or area', + prefixIcon: Icon(LucideIcons.search, size: 18), + ), + ), + const SizedBox(height: 14), + SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + for (final f in _filters) + Padding( + padding: const EdgeInsets.only(right: 8), + child: ChoiceChip( + label: Text(f), + selected: f == filter, + showCheckmark: false, + selectedColor: KrowPalette.blue, + labelStyle: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w500, + color: f == filter ? Colors.white : KrowPalette.mute, + ), + onSelected: (_) => onFilter(f), + ), + ), + ], + ), + ), + SectionLabel('${shifts.length} shifts · highest paying first'), + if (shifts.isEmpty) + const EmptyState( + icon: LucideIcons.search, + title: 'Nothing matches', + message: 'Try a different filter or clear your search.', + ) + else + for (final shift in shifts) + Padding( + padding: const EdgeInsets.only(bottom: 11), + child: ShiftCard( + shift: shift, + showDate: true, + onTap: () => context.push('/shift/${shift.id}'), + trailingAction: _ApplyButton(shift: shift), + ), + ), + ], + ); + } +} + +class _ApplyButton extends ConsumerWidget { + const _ApplyButton({required this.shift}); + + final Shift shift; + + @override + Widget build(BuildContext context, WidgetRef ref) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + Fmt.money(shift.scheduledPay), + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + ), + ), + const SizedBox(width: 10), + FilledButton( + onPressed: () { + HapticFeedback.selectionClick(); + ref.read(shiftsProvider.notifier).apply(shift.id); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + '${shift.role} at ${shift.business} booked for ' + '${Fmt.dayShort(shift.start)}', + ), + ), + ); + }, + style: FilledButton.styleFrom( + minimumSize: const Size(0, 34), + padding: const EdgeInsets.symmetric(horizontal: 16), + textStyle: const TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w700, + ), + ), + child: const Text('Apply'), + ), + ], + ); + } +} + +class _HistoryTab extends ConsumerWidget { + const _HistoryTab(); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final history = ref.watch(historyShiftsProvider); + final completed = history + .where((s) => s.status == ShiftStatus.completed) + .length; + final cancelled = history + .where((s) => s.status == ShiftStatus.cancelled) + .length; + final logged = ref.watch(hoursLoggedProvider); + + return ListView( + padding: const EdgeInsets.fromLTRB(20, 18, 20, 24), + children: [ + StatRail( + stats: [ + ('Completed', '$completed'), + ('Cancelled', '$cancelled'), + ('Logged', Fmt.duration(logged)), + ], + ), + const SectionLabel('Everything you have worked'), + if (history.isEmpty) + const EmptyState( + icon: LucideIcons.history, + title: 'No history yet', + message: 'Shifts you finish or cancel will show up here.', + ) + else + for (final shift in history) + Padding( + padding: const EdgeInsets.only(bottom: 11), + child: ShiftCard( + shift: shift, + showDate: true, + onTap: () => context.push('/shift/${shift.id}'), + ), + ), + ], + ); + } +} diff --git a/lib/screens/timecard_screens.dart b/lib/screens/timecard_screens.dart new file mode 100644 index 0000000..c5da005 --- /dev/null +++ b/lib/screens/timecard_screens.dart @@ -0,0 +1,388 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/timecard.dart'; +import '../state/timecards_controller.dart'; +import '../widgets/common.dart'; + +class TimecardsScreen extends ConsumerWidget { + const TimecardsScreen({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + final cards = ref.watch(timecardsProvider); + final pending = cards.where((c) => c.status == TimecardStatus.needsReview); + + return Scaffold( + appBar: AppBar( + title: const Text('Your timecards'), + actions: [ + if (pending.isNotEmpty) + Padding( + padding: const EdgeInsets.only(right: 16), + child: Center( + child: StatusChip( + '${pending.length} to review', + tone: ChipTone.yellow, + ), + ), + ), + ], + ), + body: cards.isEmpty + ? const Padding( + padding: EdgeInsets.all(20), + child: EmptyState( + icon: LucideIcons.fileText, + title: 'No timecards yet', + message: 'One is filed automatically every time you clock out.', + ), + ) + : ListView.separated( + padding: const EdgeInsets.fromLTRB(20, 16, 20, 28), + itemCount: cards.length, + separatorBuilder: (_, _) => const SizedBox(height: 11), + itemBuilder: (context, i) => _TimecardTile(card: cards[i]), + ), + ); + } +} + +class _TimecardTile extends StatelessWidget { + const _TimecardTile({required this.card}); + + final Timecard card; + + @override + Widget build(BuildContext context) { + final (label, tone) = switch (card.status) { + TimecardStatus.needsReview => ('Needs review', ChipTone.yellow), + TimecardStatus.approved => ('Approved', ChipTone.neutral), + TimecardStatus.disputed => ('Disputed', ChipTone.danger), + }; + + return KrowCard( + onTap: () => context.push('/timecard/${card.id}'), + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + BusinessBadge(card.business[0], size: 40), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + card.role, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + Text( + '${card.business} · ${Fmt.dayShort(card.date)}', + style: const TextStyle( + fontSize: 12.5, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + StatusChip(label, tone: tone), + ], + ), + const SizedBox(height: 14), + const Divider(height: 1), + const SizedBox(height: 12), + Row( + children: [ + Expanded( + child: _MiniStat( + LucideIcons.calendar, + 'Scheduled', + Fmt.window(card.scheduledStart, card.scheduledEnd), + ), + ), + Container(width: 1, height: 34, color: KrowPalette.line), + Expanded( + child: _MiniStat( + LucideIcons.clock, + 'Clocked', + Fmt.window(card.clockIn, card.clockOut), + highlight: true, + ), + ), + ], + ), + const SizedBox(height: 12), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'Filed ${Fmt.time(card.submittedAt)} · ' + '${Fmt.duration(card.worked)}', + style: const TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w600, + color: Color(0xFF949FA5), + ), + ), + Text( + Fmt.money(card.amount), + style: const TextStyle( + fontSize: 17, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + ), + ), + ], + ), + ], + ), + ); + } +} + +class _MiniStat extends StatelessWidget { + const _MiniStat(this.icon, this.label, this.value, {this.highlight = false}); + + final IconData icon; + final String label; + final String value; + final bool highlight; + + @override + Widget build(BuildContext context) { + return Row( + children: [ + Container( + width: 34, + height: 34, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(10), + ), + child: Icon(icon, size: 16, color: KrowPalette.blue), + ), + const SizedBox(width: 10), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: const TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: KrowPalette.mute, + ), + ), + Text( + value, + style: TextStyle( + fontSize: 12.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.3, + color: highlight ? KrowPalette.blue : KrowPalette.ink, + ), + ), + ], + ), + ), + ], + ); + } +} + +/// Review a filed timecard: confirm it, or raise an issue before it locks for +/// payroll. +class TimecardReviewScreen extends ConsumerWidget { + const TimecardReviewScreen({super.key, required this.timecardId}); + + final String timecardId; + + Future _dispute(BuildContext context, WidgetRef ref) async { + final controller = TextEditingController(); + final note = await showDialog( + context: context, + builder: (context) => AlertDialog( + title: const Text('Report an issue'), + content: TextField( + controller: controller, + autofocus: true, + maxLines: 4, + decoration: const InputDecoration( + hintText: 'What is wrong with these hours?', + ), + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: const Text('Cancel'), + ), + FilledButton( + onPressed: () => Navigator.pop(context, controller.text.trim()), + style: FilledButton.styleFrom(minimumSize: const Size(0, 44)), + child: const Text('Send'), + ), + ], + ), + ); + if (note == null || note.isEmpty || !context.mounted) return; + ref.read(timecardsProvider.notifier).dispute(timecardId, note); + ScaffoldMessenger.of( + context, + ).showSnackBar(const SnackBar(content: Text('Issue raised with payroll'))); + context.pop(); + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + final card = ref.watch(timecardsProvider.notifier).byId(timecardId); + if (card == null) { + return Scaffold( + appBar: AppBar(), + body: const Center(child: Text('Timecard not found.')), + ); + } + + final variance = card.varianceMinutes; + final open = card.status == TimecardStatus.needsReview; + + return Scaffold( + appBar: AppBar( + title: const Text('Review timecard'), + actions: [ + Padding( + padding: const EdgeInsets.only(right: 16), + child: Center( + child: StatusChip( + card.status.label, + tone: switch (card.status) { + TimecardStatus.needsReview => ChipTone.yellow, + TimecardStatus.approved => ChipTone.neutral, + TimecardStatus.disputed => ChipTone.danger, + }, + ), + ), + ), + ], + ), + body: ListView( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 28), + children: [ + Text( + '${card.role} at ${card.business}', + style: const TextStyle( + fontSize: 24, + fontWeight: FontWeight.w700, + letterSpacing: -0.8, + ), + ), + const SizedBox(height: 4), + Text( + Fmt.dayFull(card.date), + style: const TextStyle(fontSize: 13.5, color: KrowPalette.mute), + ), + const SizedBox(height: 16), + InfoBanner( + open + ? 'Sent automatically when you clocked out. You have 7 days to ' + 'raise an issue before it locks for payroll.' + : 'This timecard is ${card.status.label.toLowerCase()}.', + ), + const SectionLabel('Shift'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Date', Fmt.dayShort(card.date)), + const Divider(height: 1), + DetailRow( + 'Scheduled', + Fmt.window(card.scheduledStart, card.scheduledEnd), + ), + const Divider(height: 1), + DetailRow( + 'Clocked', + Fmt.window(card.clockIn, card.clockOut), + valueColor: KrowPalette.blue, + ), + const Divider(height: 1), + DetailRow( + 'Variance', + variance == 0 + ? 'On time' + : '${variance > 0 ? '+' : ''}$variance min', + valueColor: variance > 5 + ? const Color(0xFFA6403F) + : KrowPalette.blue, + ), + ], + ), + ), + const SectionLabel('Hours and pay'), + KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + DetailRow('Base rate', '${Fmt.money(card.rate)}/hr'), + const Divider(height: 1), + DetailRow('Break, unpaid', '${card.breakMinutes} min'), + const Divider(height: 1), + DetailRow( + 'Regular · ${Fmt.duration(card.worked)}', + Fmt.money(card.amount), + ), + const Divider(height: 1), + DetailRow( + 'Total, pre-tax', + Fmt.money(card.amount), + emphasis: true, + ), + ], + ), + ), + if (card.disputeNote != null) ...[ + const SectionLabel('Your note'), + KrowCard(child: Text(card.disputeNote!)), + ], + const SizedBox(height: 22), + if (open) + Row( + children: [ + Expanded( + child: OutlinedButton( + onPressed: () => _dispute(context, ref), + child: const Text('Report an issue'), + ), + ), + const SizedBox(width: 10), + Expanded( + child: FilledButton( + onPressed: () { + ref.read(timecardsProvider.notifier).approve(card.id); + ScaffoldMessenger.of(context).showSnackBar( + const SnackBar(content: Text('Timecard approved')), + ); + context.pop(); + }, + child: const Text('Looks right'), + ), + ), + ], + ), + ], + ), + ); + } +} diff --git a/lib/screens/today_screen.dart b/lib/screens/today_screen.dart new file mode 100644 index 0000000..bf35937 --- /dev/null +++ b/lib/screens/today_screen.dart @@ -0,0 +1,421 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:go_router/go_router.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/shift.dart'; +import '../state/availability_controller.dart'; +import '../state/compliance_controller.dart'; +import '../state/profile_controller.dart'; +import '../state/shifts_controller.dart'; +import '../widgets/collapsing_header.dart'; +import '../widgets/common.dart'; +import '../widgets/shift_card.dart'; + +class TodayScreen extends ConsumerWidget { + const TodayScreen({super.key}); + + String _greeting() { + final h = DateTime.now().hour; + if (h < 12) return 'Good morning'; + if (h < 18) return 'Good afternoon'; + return 'Good evening'; + } + + @override + Widget build(BuildContext context, WidgetRef ref) { + final worker = ref.watch(workerStatsProvider); + final next = ref.watch(nextShiftProvider); + final open = ref.watch(openShiftsProvider); + final scheduled = ref.watch(scheduledEarningsProvider); + final hours = ref.watch(hoursLoggedProvider); + final daysSet = ref.watch(daysSetProvider); + final compliant = ref.watch(isCompliantProvider); + final (done, total) = ref.watch(complianceProgressProvider); + + return Scaffold( + body: CustomScrollView( + slivers: [ + KrowSliverHeader( + expandedHeight: 152, + collapsedHeight: 60, + builder: (context, t) => HeaderCrossFade( + t: t, + expandedHeight: 152, + expanded: Padding( + padding: const EdgeInsets.fromLTRB(20, 8, 20, 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + _Avatar(worker.initials), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _greeting().toUpperCase(), + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.6, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.5), + ), + ), + const SizedBox(height: 2), + Text( + worker.name, + style: const TextStyle( + fontSize: 22, + fontWeight: FontWeight.w700, + letterSpacing: -0.7, + color: Colors.white, + ), + ), + ], + ), + ), + HeaderIconButton( + icon: LucideIcons.messageCircle, + tooltip: 'Support', + onPressed: () => context.push('/support'), + ), + ], + ), + const SizedBox(height: 18), + Row( + children: [ + // Flexible, not free-sized: on a 320px screen the two + // captions plus the rule are wider than the header. + Flexible( + child: _HeaderStat( + Fmt.money(scheduled), + 'This period', + ), + ), + Container( + width: 1, + height: 34, + margin: const EdgeInsets.symmetric(horizontal: 18), + color: Colors.white24, + ), + Flexible( + child: _HeaderStat( + Fmt.duration(hours), + 'Hours logged', + ), + ), + ], + ), + ], + ), + ), + // Once collapsed, keep who you are and the figure that matters, + // plus the one control that was in the open state. + collapsed: Padding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 0), + child: Row( + children: [ + _Avatar(worker.initials, size: 32), + const SizedBox(width: 10), + Expanded( + child: Text( + worker.name, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + color: Colors.white, + ), + ), + ), + Text( + Fmt.money(scheduled), + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + letterSpacing: -0.5, + color: KrowPalette.yellow, + ), + ), + const SizedBox(width: 10), + HeaderIconButton( + icon: LucideIcons.messageCircle, + tooltip: 'Support', + onPressed: () => context.push('/support'), + ), + ], + ), + ), + ), + ), + SliverPadding( + padding: const EdgeInsets.fromLTRB(20, 0, 20, 24), + sliver: SliverList.list( + children: [ + if (!compliant) ...[ + const SizedBox(height: 16), + KrowCard( + onTap: () => context.push('/compliance'), + padding: const EdgeInsets.all(14), + child: Row( + children: [ + const Icon( + LucideIcons.triangleAlert, + size: 20, + color: KrowPalette.ink, + ), + const SizedBox(width: 12), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + 'Finish your compliance', + style: TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(height: 2), + Text( + '$done of $total items cleared', + style: const TextStyle( + fontSize: 12, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + const StatusChip('Action', tone: ChipTone.yellow), + ], + ), + ), + ], + const SectionLabel('Up next'), + if (next == null) + EmptyState( + icon: LucideIcons.ticket, + title: 'Nothing booked', + message: + 'Open shifts near you start at ' + '${open.isEmpty ? '-' : Fmt.money(open.last.rate)}/hr.', + action: FilledButton( + onPressed: () => context.go('/shifts'), + child: const Text('Browse open shifts'), + ), + ) + else + ShiftCard( + shift: next, + showDate: !Fmt.sameDay(next.start, DateTime.now()), + onTap: () => context.push('/shift/${next.id}'), + ), + if (next != null && next.status == ShiftStatus.active) ...[ + const SizedBox(height: 10), + FilledButton.icon( + onPressed: () => context.go('/clock'), + icon: const Icon(LucideIcons.squareCheck, size: 18), + label: const Text('You are on shift - go to clock'), + ), + ], + const SizedBox(height: 14), + Row( + children: [ + Expanded( + child: _QuickTile( + icon: LucideIcons.search, + label: 'Find shifts', + caption: '${open.length} OPEN', + onTap: () => context.go('/shifts'), + ), + ), + const SizedBox(width: 10), + Expanded( + child: _QuickTile( + icon: LucideIcons.calendar, + label: 'Availability', + caption: '$daysSet DAYS SET', + onTap: () => context.push('/availability'), + ), + ), + const SizedBox(width: 10), + Expanded( + child: _QuickTile( + icon: LucideIcons.banknote, + label: 'Earnings', + caption: 'PENDING', + onTap: () => context.go('/pay'), + ), + ), + ], + ), + SectionLabel( + 'Matched to you', + trailing: TextButton( + onPressed: () => context.go('/shifts'), + child: const Text('See all'), + ), + ), + if (open.isEmpty) + const InfoBanner( + 'No open shifts right now. Turn on more availability blocks ' + 'and we will match you to more work.', + ) + else + for (final shift in open.take(3)) + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: ShiftCard( + shift: shift, + showDate: true, + onTap: () => context.push('/shift/${shift.id}'), + ), + ), + ], + ), + ), + ], + ), + ); + } +} + +/// The worker's initials, used at two sizes as the header collapses. +class _Avatar extends StatelessWidget { + const _Avatar(this.initials, {this.size = 44}); + + final String initials; + final double size; + + @override + Widget build(BuildContext context) { + return Container( + width: size, + height: size, + alignment: Alignment.center, + decoration: BoxDecoration( + color: KrowPalette.yellow, + borderRadius: BorderRadius.circular(size / 3.4), + ), + child: Text( + initials, + style: TextStyle( + fontSize: size * 0.39, + fontWeight: FontWeight.w700, + color: KrowPalette.ink, + ), + ), + ); + } +} + +class _HeaderStat extends StatelessWidget { + const _HeaderStat(this.value, this.caption); + + final String value; + final String caption; + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Both lines hold to one line and shrink to fit: a wrapped caption + // would push the header past its pinned height. + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + value, + maxLines: 1, + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.w700, + letterSpacing: -0.8, + color: Colors.white, + ), + ), + ), + const SizedBox(height: 3), + FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + caption.toUpperCase(), + maxLines: 1, + style: TextStyle( + fontSize: 9.5, + letterSpacing: 1.4, + fontWeight: FontWeight.w600, + color: Colors.white.withValues(alpha: 0.5), + ), + ), + ), + ], + ); + } +} + +class _QuickTile extends StatelessWidget { + const _QuickTile({ + required this.icon, + required this.label, + required this.caption, + required this.onTap, + }); + + final IconData icon; + final String label; + final String caption; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return KrowCard( + onTap: onTap, + padding: const EdgeInsets.fromLTRB(12, 14, 12, 14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 34, + height: 34, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(11), + ), + child: Icon(icon, size: 17, color: KrowPalette.blue), + ), + const SizedBox(height: 22), + Text( + label, + style: const TextStyle( + fontSize: 13.5, + fontWeight: FontWeight.w600, + letterSpacing: -0.2, + ), + ), + const SizedBox(height: 2), + Text( + caption, + style: const TextStyle( + fontSize: 9.5, + fontWeight: FontWeight.w600, + letterSpacing: 0.5, + color: Color(0xFF949FA5), + ), + ), + ], + ), + ); + } +} diff --git a/lib/state/availability_controller.dart b/lib/state/availability_controller.dart new file mode 100644 index 0000000..1076900 --- /dev/null +++ b/lib/state/availability_controller.dart @@ -0,0 +1,128 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../models/availability.dart'; +import 'session_controller.dart'; + +/// Availability is stored as `yyyy-mm-dd` -> the blocks switched on that day. +typedef AvailabilityMap = Map>; + +String dayKey(DateTime d) => + '${d.year}-${d.month.toString().padLeft(2, '0')}-${d.day.toString().padLeft(2, '0')}'; + +class AvailabilityController extends Notifier { + static const _key = 'availability'; + + SharedPreferences get _prefs => ref.read(prefsProvider); + + @override + AvailabilityMap build() { + final raw = _prefs.getStringList(_key) ?? const []; + final map = >{}; + for (final entry in raw) { + // Stored as "2026-08-14:morning,evening". + final parts = entry.split(':'); + if (parts.length != 2) continue; + final blocks = parts[1] + .split(',') + .where((s) => s.isNotEmpty) + .map( + (name) => DayBlock.values.firstWhere( + (b) => b.name == name, + orElse: () => DayBlock.morning, + ), + ) + .toSet(); + if (blocks.isNotEmpty) map[parts[0]] = blocks; + } + return map; + } + + void _persist(AvailabilityMap map) { + _prefs.setStringList(_key, [ + for (final e in map.entries) + if (e.value.isNotEmpty) + '${e.key}:${e.value.map((b) => b.name).join(',')}', + ]); + state = map; + } + + Set blocksFor(DateTime day) => state[dayKey(day)] ?? {}; + + bool isDayOff(DateTime day) => blocksFor(day).isEmpty; + + void toggleBlock(DateTime day, DayBlock block) { + final map = { + for (final e in state.entries) e.key: {...e.value}, + }; + final key = dayKey(day); + final blocks = map[key] ?? {}; + if (!blocks.remove(block)) blocks.add(block); + if (blocks.isEmpty) { + map.remove(key); + } else { + map[key] = blocks; + } + _persist(map); + } + + /// The day toggle: all three blocks on, or the day cleared. + void setDayAvailable(DateTime day, bool available) { + final map = { + for (final e in state.entries) e.key: {...e.value}, + }; + final key = dayKey(day); + if (available) { + map[key] = DayBlock.values.toSet(); + } else { + map.remove(key); + } + _persist(map); + } + + /// Presets across the visible week: all days, weekdays only, weekends only. + void applyPreset( + List week, { + required bool Function(DateTime) test, + }) { + final map = { + for (final e in state.entries) e.key: {...e.value}, + }; + for (final day in week) { + final key = dayKey(day); + if (test(day)) { + map[key] = DayBlock.values.toSet(); + } else { + map.remove(key); + } + } + _persist(map); + } + + void clearWeek(List week) { + final map = { + for (final e in state.entries) e.key: {...e.value}, + }; + for (final day in week) { + map.remove(dayKey(day)); + } + _persist(map); + } +} + +final availabilityProvider = + NotifierProvider( + AvailabilityController.new, + ); + +/// How many days in the coming week have at least one block switched on. +final daysSetProvider = Provider((ref) { + final map = ref.watch(availabilityProvider); + final now = DateTime.now(); + var count = 0; + for (var i = 0; i < 7; i++) { + final d = now.add(Duration(days: i)); + if ((map[dayKey(d)] ?? const {}).isNotEmpty) count++; + } + return count; +}); diff --git a/lib/state/compliance_controller.dart b/lib/state/compliance_controller.dart new file mode 100644 index 0000000..1363657 --- /dev/null +++ b/lib/state/compliance_controller.dart @@ -0,0 +1,178 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../models/compliance.dart'; +import 'seed.dart'; + +/// The four compliance sections, each a list the worker can act on. +enum ComplianceSection { documents, certificates, taxForms, wardrobe } + +extension ComplianceSectionX on ComplianceSection { + String get title => switch (this) { + ComplianceSection.documents => 'Documents', + ComplianceSection.certificates => 'Certificates', + ComplianceSection.taxForms => 'Tax forms', + ComplianceSection.wardrobe => 'Attire', + }; + + String get subtitle => switch (this) { + ComplianceSection.documents => 'ID, SSN, work permit, address', + ComplianceSection.certificates => 'Food handler, RBS and more', + ComplianceSection.taxForms => 'Form I-9 and Form W-4', + ComplianceSection.wardrobe => "Photos of what you'll wear", + }; +} + +class ComplianceData { + const ComplianceData({ + required this.documents, + required this.certificates, + required this.taxForms, + required this.wardrobe, + }); + + final List documents; + final List certificates; + final List taxForms; + final List wardrobe; + + List section(ComplianceSection s) => switch (s) { + ComplianceSection.documents => documents, + ComplianceSection.certificates => certificates, + ComplianceSection.taxForms => taxForms, + ComplianceSection.wardrobe => wardrobe, + }; + + List get all => [ + ...documents, + ...certificates, + ...taxForms, + ...wardrobe, + ]; + + ComplianceData copyWith({ + List? documents, + List? certificates, + List? taxForms, + List? wardrobe, + }) => ComplianceData( + documents: documents ?? this.documents, + certificates: certificates ?? this.certificates, + taxForms: taxForms ?? this.taxForms, + wardrobe: wardrobe ?? this.wardrobe, + ); +} + +class ComplianceController extends Notifier { + @override + ComplianceData build() => ComplianceData( + documents: Seed.documents(), + certificates: Seed.certificates(), + taxForms: Seed.taxForms(), + wardrobe: Seed.wardrobe(), + ); + + List _apply( + List list, + String id, + ComplianceItem Function(ComplianceItem) f, + ) => [ + for (final i in list) + if (i.id == id) f(i) else i, + ]; + + void _update( + ComplianceSection section, + String id, + ComplianceItem Function(ComplianceItem) f, + ) { + final s = state; + state = switch (section) { + ComplianceSection.documents => s.copyWith( + documents: _apply(s.documents, id, f), + ), + ComplianceSection.certificates => s.copyWith( + certificates: _apply(s.certificates, id, f), + ), + ComplianceSection.taxForms => s.copyWith( + taxForms: _apply(s.taxForms, id, f), + ), + ComplianceSection.wardrobe => s.copyWith( + wardrobe: _apply(s.wardrobe, id, f), + ), + }; + } + + /// Stand-in for the camera / file picker: attaching a file sends the item + /// back for review. + void uploadFile(ComplianceSection section, String id, String fileName) { + _update( + section, + id, + (i) => i.copyWith( + state: ComplianceState.pending, + statusLabel: 'In review', + fileName: fileName, + fileMeta: 'Uploaded just now', + ), + ); + } + + void removeFile(ComplianceSection section, String id) { + _update( + section, + id, + (i) => ComplianceItem( + id: i.id, + title: i.title, + subtitle: i.subtitle, + state: ComplianceState.missing, + statusLabel: 'Not added', + required_: i.required_, + ), + ); + } + + void setExpiry(ComplianceSection section, String id, DateTime date) { + _update(section, id, (i) => i.copyWith(expires: date)); + } + + ComplianceItem? find(ComplianceSection section, String id) { + for (final i in state.section(section)) { + if (i.id == id) return i; + } + return null; + } +} + +final complianceProvider = + NotifierProvider( + ComplianceController.new, + ); + +/// `(verified, total)` across every required item — what the hub reports. +final complianceProgressProvider = Provider<(int, int)>((ref) { + final items = ref.watch(complianceProvider).all.where((i) => i.required_); + final total = items.length; + final done = items.where((i) => i.state == ComplianceState.verified).length; + return (done, total); +}); + +/// Whether the worker is cleared to take shifts at all. +final isCompliantProvider = Provider((ref) { + final (done, total) = ref.watch(complianceProgressProvider); + return done == total; +}); + +final sectionProgressProvider = Provider.family<(int, int), ComplianceSection>(( + ref, + section, +) { + final items = ref + .watch(complianceProvider) + .section(section) + .where((i) => i.required_); + return ( + items.where((i) => i.state == ComplianceState.verified).length, + items.length, + ); +}); diff --git a/lib/state/profile_controller.dart b/lib/state/profile_controller.dart new file mode 100644 index 0000000..b209c6d --- /dev/null +++ b/lib/state/profile_controller.dart @@ -0,0 +1,168 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +import '../models/compliance.dart'; +import '../models/shift.dart'; +import '../models/worker.dart'; +import 'session_controller.dart'; +import 'shifts_controller.dart'; + +class ProfileState { + const ProfileState({ + required this.worker, + required this.settings, + required this.skills, + required this.contacts, + this.bank, + this.newsletter = false, + }); + + final Worker worker; + + /// Settings the worker has worked in, and the trades they can do. + final Set settings; + final Set skills; + final List contacts; + final BankAccount? bank; + final bool newsletter; + + ProfileState copyWith({ + Worker? worker, + Set? settings, + Set? skills, + List? contacts, + BankAccount? bank, + bool? newsletter, + }) => ProfileState( + worker: worker ?? this.worker, + settings: settings ?? this.settings, + skills: skills ?? this.skills, + contacts: contacts ?? this.contacts, + bank: bank ?? this.bank, + newsletter: newsletter ?? this.newsletter, + ); +} + +class ProfileController extends Notifier { + static const _kSettings = 'profile_settings'; + static const _kSkills = 'profile_skills'; + static const _kNewsletter = 'profile_newsletter'; + static const _kName = 'profile_name'; + + SharedPreferences get _prefs => ref.read(prefsProvider); + + @override + ProfileState build() { + final p = _prefs; + final phone = ref.watch(sessionProvider).phone; + return ProfileState( + worker: Worker( + name: p.getString(_kName) ?? 'Iliana Ortega', + role: 'Barista', + city: 'San Jose', + phone: phone ?? '+1 408 555 0148', + onTimePercent: 50, + noShows: 1, + cancellations: 1, + ), + settings: + (p.getStringList(_kSettings) ?? + const ['Hospitality', 'Events', 'Catering']) + .toSet(), + skills: + (p.getStringList(_kSkills) ?? + const ['Barista', 'Customer service', 'Food service']) + .toSet(), + contacts: [ + EmergencyContact( + name: 'Carlos Ortega', + phone: '+1 555 001 0006', + relationship: 'Spouse', + ), + ], + newsletter: p.getBool(_kNewsletter) ?? false, + ); + } + + void updateName(String name) { + _prefs.setString(_kName, name); + state = state.copyWith(worker: state.worker.copyWith(name: name)); + } + + void toggleSetting(String value) { + final next = {...state.settings}; + if (!next.remove(value)) next.add(value); + _prefs.setStringList(_kSettings, next.toList()); + state = state.copyWith(settings: next); + } + + void toggleSkill(String value) { + final next = {...state.skills}; + if (!next.remove(value)) next.add(value); + _prefs.setStringList(_kSkills, next.toList()); + state = state.copyWith(skills: next); + } + + void addSkill(String value) { + final trimmed = value.trim(); + if (trimmed.isEmpty) return; + final next = {...state.skills, trimmed}; + _prefs.setStringList(_kSkills, next.toList()); + state = state.copyWith(skills: next); + } + + void saveContact(EmergencyContact contact, {int? index}) { + final next = [...state.contacts]; + if (index != null && index < next.length) { + next[index] = contact; + } else { + next.add(contact); + } + state = state.copyWith(contacts: next); + } + + void removeContact(int index) { + final next = [...state.contacts]..removeAt(index); + state = state.copyWith(contacts: next); + } + + void saveBank(BankAccount account) { + state = state.copyWith(bank: account); + } + + void setNewsletter(bool value) { + _prefs.setBool(_kNewsletter, value); + state = state.copyWith(newsletter: value); + } +} + +final profileProvider = NotifierProvider( + ProfileController.new, +); + +/// Live stats derived from the shift list, so the profile reflects what the +/// worker has actually done in this session. +final workerStatsProvider = Provider((ref) { + final base = ref.watch(profileProvider).worker; + final shifts = ref.watch(shiftsProvider); + final completed = shifts + .where((s) => s.status == ShiftStatus.completed) + .toList(); + final noShows = shifts.where((s) => s.status == ShiftStatus.noShow).length; + final cancels = shifts.where((s) => s.status == ShiftStatus.cancelled).length; + final onTime = completed + .where( + (s) => + s.clockIn != null && + !s.clockIn!.isAfter(s.start.add(const Duration(minutes: 5))), + ) + .length; + return base.copyWith( + shiftsWorked: completed.length, + onTimePercent: completed.isEmpty + ? 100 + : (onTime * 100 / completed.length).round(), + noShows: noShows, + cancellations: cancels, + ); +}); diff --git a/lib/state/seed.dart b/lib/state/seed.dart new file mode 100644 index 0000000..86dc9ae --- /dev/null +++ b/lib/state/seed.dart @@ -0,0 +1,392 @@ +import '../models/compliance.dart'; +import '../models/shift.dart'; +import '../models/timecard.dart'; + +/// Demo content. Everything is anchored to "now" so the app is live whenever +/// it is opened: the next shift always starts in 41 minutes. +abstract final class Seed { + static DateTime get _now => DateTime.now(); + + static DateTime _at(int dayOffset, int hour, int minute) { + final base = _now.add(Duration(days: dayOffset)); + return DateTime(base.year, base.month, base.day, hour, minute); + } + + static const _baristaReqs = [ + 'Government ID', + 'Food handler certification', + 'Black pants', + 'Black shirt', + 'Non-slip black shoes', + ]; + + static List shifts() { + final now = _now; + // Inside the 30-minute clock-in window, so the app opens on a shift you + // can actually start. + final soon = now.add(const Duration(minutes: 20)); + return [ + // Today: the shift you are about to clock into. + Shift( + id: 's1', + role: 'Barista', + business: 'Zoox', + venue: 'Zoox - San Jose Hub', + address: '848 E Gish Rd, San Jose CA', + start: soon, + end: soon.add(const Duration(hours: 6)), + rate: 21.00, + status: ShiftStatus.booked, + distanceMiles: 2.4, + manager: 'Kirk R. - Owner', + requirements: _baristaReqs, + ), + Shift( + id: 's2', + role: 'Server', + business: 'Google LLC', + venue: 'Google LLC - Midpoint', + address: 'Midpoint, Sunnyvale CA', + start: _at(1, 13, 0), + end: _at(1, 18, 0), + rate: 24.00, + status: ShiftStatus.booked, + distanceMiles: 3.1, + manager: 'Dana W. - Floor lead', + requirements: _baristaReqs, + ), + // Open market, highest paying first. + Shift( + id: 's3', + role: 'Bartender', + business: 'Google LLC', + venue: 'Google LLC - Midpoint', + address: 'Midpoint, Sunnyvale CA', + start: _at(2, 16, 0), + end: _at(2, 23, 0), + rate: 28.00, + status: ShiftStatus.open, + distanceMiles: 3.1, + requirements: [..._baristaReqs, 'Responsible beverage service'], + ), + Shift( + id: 's4', + role: 'Barista', + business: 'Zoox', + venue: 'Zoox - San Jose Hub', + address: '848 E Gish Rd, San Jose CA', + start: _at(3, 18, 0), + end: _at(3, 23, 50), + rate: 21.00, + status: ShiftStatus.open, + distanceMiles: 2.4, + requirements: _baristaReqs, + ), + Shift( + id: 's5', + role: 'Host', + business: 'Google LLC', + venue: 'Google LLC - Midpoint', + address: 'Midpoint, Sunnyvale CA', + start: _at(4, 11, 0), + end: _at(4, 17, 0), + rate: 19.50, + status: ShiftStatus.open, + distanceMiles: 3.1, + requirements: _baristaReqs, + ), + Shift( + id: 's6', + role: 'Banquet server', + business: 'Legendary Events', + venue: 'Legendary Events - Convention Centre', + address: '150 W San Carlos St, San Jose CA', + start: _at(5, 9, 0), + end: _at(5, 17, 30), + rate: 22.50, + status: ShiftStatus.open, + distanceMiles: 4.8, + requirements: _baristaReqs, + ), + // Worked history. + Shift( + id: 's7', + role: 'Barista', + business: 'Zoox', + venue: 'Zoox - San Jose Hub', + address: '848 E Gish Rd, San Jose CA', + start: _at(-4, 17, 50), + end: _at(-4, 23, 50), + rate: 21.00, + status: ShiftStatus.completed, + distanceMiles: 2.4, + clockIn: _at(-4, 18, 1), + clockOut: _at(-4, 23, 50), + requirements: _baristaReqs, + ), + Shift( + id: 's8', + role: 'Barista', + business: 'Google LLC', + venue: 'Google LLC - Midpoint', + address: 'Midpoint, Sunnyvale CA', + start: _at(-6, 11, 0), + end: _at(-6, 18, 0), + rate: 21.00, + status: ShiftStatus.cancelled, + distanceMiles: 3.1, + requirements: _baristaReqs, + ), + Shift( + id: 's9', + role: 'Barista', + business: 'Google LLC', + venue: 'Google LLC - Midpoint', + address: 'Midpoint, Sunnyvale CA', + start: _at(-13, 9, 0), + end: _at(-13, 15, 0), + rate: 21.00, + status: ShiftStatus.noShow, + distanceMiles: 3.1, + requirements: _baristaReqs, + ), + ]; + } + + static List timecards() { + final worked = shifts().firstWhere((s) => s.id == 's7'); + return [ + Timecard( + id: 'tc1', + shiftId: worked.id, + role: worked.role, + business: worked.business, + scheduledStart: worked.start, + scheduledEnd: worked.end, + clockIn: worked.clockIn!, + clockOut: worked.clockOut!, + breakMinutes: worked.breakMinutes, + rate: worked.rate, + status: TimecardStatus.needsReview, + submittedAt: worked.clockOut!.add(const Duration(minutes: 12)), + ), + ]; + } + + static List documents() => [ + ComplianceItem( + id: 'd1', + title: 'Government ID', + subtitle: 'State ID or passport', + state: ComplianceState.verified, + fileName: 'government-id-front.jpg', + fileMeta: '2.1 MB - uploaded 2 Aug', + expires: DateTime(2029, 3, 14), + ), + ComplianceItem( + id: 'd2', + title: 'Social security', + subtitle: 'Card or SSA letter', + state: ComplianceState.verified, + fileName: 'ssn-card.jpg', + fileMeta: '1.2 MB - uploaded 2 Aug', + ), + ComplianceItem( + id: 'd3', + title: 'Work permit', + subtitle: 'Right-to-work evidence', + state: ComplianceState.verified, + fileName: 'work-permit.pdf', + fileMeta: '640 KB - uploaded 2 Aug', + ), + ComplianceItem( + id: 'd4', + title: 'Proof of address', + subtitle: 'Bill or statement, last 90 days', + state: ComplianceState.pending, + statusLabel: 'In review', + fileName: 'utility-bill.pdf', + fileMeta: '380 KB - uploaded yesterday', + ), + ]; + + static List certificates() => [ + ComplianceItem( + id: 'c1', + title: 'Food handler certification', + subtitle: 'Accepted by all California venues', + state: ComplianceState.verified, + statusLabel: 'Validated', + fileName: 'food-safety-certificate.pdf', + fileMeta: '840 KB - uploaded 2 Aug', + expires: DateTime(2027, 3, 14), + ), + ComplianceItem( + id: 'c2', + title: 'Responsible beverage service', + subtitle: 'Needed for bartender shifts', + state: ComplianceState.verified, + statusLabel: 'Validated', + fileName: 'rbs-certificate.pdf', + fileMeta: '510 KB - uploaded 2 Aug', + expires: DateTime(2028, 1, 9), + ), + ComplianceItem( + id: 'c3', + title: 'CPR / AED', + subtitle: 'Adds around 4 shifts a week near you', + state: ComplianceState.missing, + statusLabel: 'Not added', + required_: false, + ), + ComplianceItem( + id: 'c4', + title: 'Forklift licence', + subtitle: 'Warehouse and logistics roles', + state: ComplianceState.missing, + statusLabel: 'Not added', + required_: false, + ), + ]; + + static List taxForms() => [ + ComplianceItem( + id: 't1', + title: 'Form I-9', + subtitle: 'Employment eligibility verification', + state: ComplianceState.verified, + statusLabel: 'Approved', + fileName: 'i9-form.pdf', + fileMeta: 'Approved 3 Aug', + ), + ComplianceItem( + id: 't2', + title: 'Form W-4', + subtitle: 'Sets how much tax is withheld', + state: ComplianceState.verified, + statusLabel: 'Approved', + fileName: 'w4-form.pdf', + fileMeta: 'Approved 3 Aug', + ), + ]; + + static List wardrobe() => [ + ComplianceItem( + id: 'w1', + title: 'Black pants', + subtitle: 'Solid black dress pants or slacks', + state: ComplianceState.verified, + statusLabel: 'Approved', + fileName: 'black-pants.jpg', + fileMeta: '1.4 MB - uploaded 2 Aug', + ), + ComplianceItem( + id: 'w2', + title: 'Black shirt', + subtitle: 'Plain, no logos', + state: ComplianceState.verified, + statusLabel: 'Approved', + fileName: 'black-shirt.jpg', + fileMeta: '1.1 MB - uploaded 2 Aug', + ), + ComplianceItem( + id: 'w3', + title: 'Non-slip black shoes', + subtitle: 'Closed-toe, required on every shift', + state: ComplianceState.verified, + statusLabel: 'Approved', + fileName: 'black-shoes.jpg', + fileMeta: '0.9 MB - uploaded 2 Aug', + ), + ComplianceItem( + id: 'w4', + title: 'Black belt', + subtitle: 'Plain, simple buckle', + state: ComplianceState.missing, + statusLabel: 'Not added', + required_: false, + ), + ]; + + static const workSettings = [ + 'Hospitality', + 'Restaurant', + 'Warehouse', + 'Logistics', + 'Events', + 'Stadiums', + 'Education', + 'Healthcare & cafeteria', + 'Convention centre', + 'Catering', + ]; + + static const skills = [ + 'Food prep', + 'Cooking', + 'Grilling', + 'Dishwashing', + 'Food service', + 'Banquet', + 'Bartender', + 'Barista', + 'Customer service', + 'Safe food handling', + 'Event setup', + ]; + + static const supportTopics = [ + 'Shift issue', + 'Pay or billing', + 'Schedule clash', + 'Account', + 'Bug report', + 'Feature idea', + ]; + + static const faqs = >{ + 'Getting started': [ + ( + 'How do I finish my worker profile?', + 'Open Profile, then Compliance. Work down the sections until every one ' + 'shows a green tick. You can accept shifts as soon as documents, ' + 'tax forms and attire are complete.', + ), + ( + "Why can't I apply to shifts yet?", + 'Businesses only see workers who are fully compliant. Anything still ' + 'marked yellow on the compliance hub is blocking you.', + ), + ], + 'Shifts and attendance': [ + ( + 'How does clock-in work?', + 'The clock-in button unlocks 30 minutes before your shift starts, once ' + 'you are within 150 m of the venue. Tap out when you leave and the ' + 'timecard submits itself.', + ), + ( + 'What happens if I request a swap?', + 'Your shift is offered to other qualified workers. You stay responsible ' + 'for it until someone accepts, so keep an eye on notifications.', + ), + ( + 'What counts as a no-show?', + 'Not clocking in within 30 minutes of the scheduled start, with no ' + 'cancellation. No-shows cost 15 points of trust index each.', + ), + ], + 'Pay and compliance': [ + ( + 'When do I actually get paid?', + 'Semi-monthly. Each period closes on the 15th and the last day of the ' + 'month, and pays 11 days later.', + ), + ( + 'How are documents verified?', + 'A reviewer checks each upload by hand, usually within one business ' + 'day. You get a notification either way.', + ), + ], + }; +} diff --git a/lib/state/session_controller.dart b/lib/state/session_controller.dart new file mode 100644 index 0000000..088b11a --- /dev/null +++ b/lib/state/session_controller.dart @@ -0,0 +1,115 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +/// Injected in `main()` once SharedPreferences has loaded. +final prefsProvider = Provider( + (ref) => throw UnimplementedError('prefsProvider must be overridden'), +); + +class SessionState { + const SessionState({ + this.onboardingSeen = false, + this.phone, + this.signedIn = false, + this.locationGranted = false, + this.notificationsGranted = false, + this.cameraGranted = false, + }); + + final bool onboardingSeen; + final String? phone; + final bool signedIn; + final bool locationGranted; + final bool notificationsGranted; + final bool cameraGranted; + + /// The three-step permission run shown right after verification. + bool get permissionsDone => + locationGranted && notificationsGranted && cameraGranted; + + SessionState copyWith({ + bool? onboardingSeen, + String? phone, + bool? signedIn, + bool? locationGranted, + bool? notificationsGranted, + bool? cameraGranted, + }) => SessionState( + onboardingSeen: onboardingSeen ?? this.onboardingSeen, + phone: phone ?? this.phone, + signedIn: signedIn ?? this.signedIn, + locationGranted: locationGranted ?? this.locationGranted, + notificationsGranted: notificationsGranted ?? this.notificationsGranted, + cameraGranted: cameraGranted ?? this.cameraGranted, + ); +} + +class SessionController extends Notifier { + static const _kOnboarding = 'onboarding_seen'; + static const _kPhone = 'phone'; + static const _kSignedIn = 'signed_in'; + static const _kLocation = 'perm_location'; + static const _kNotifications = 'perm_notifications'; + static const _kCamera = 'perm_camera'; + + SharedPreferences get _prefs => ref.read(prefsProvider); + + @override + SessionState build() { + final p = _prefs; + return SessionState( + onboardingSeen: p.getBool(_kOnboarding) ?? false, + phone: p.getString(_kPhone), + signedIn: p.getBool(_kSignedIn) ?? false, + locationGranted: p.getBool(_kLocation) ?? false, + notificationsGranted: p.getBool(_kNotifications) ?? false, + cameraGranted: p.getBool(_kCamera) ?? false, + ); + } + + void completeOnboarding() { + _prefs.setBool(_kOnboarding, true); + state = state.copyWith(onboardingSeen: true); + } + + /// The demo backend accepts any 10-digit number and always sends `123456`. + static const demoCode = '123456'; + + String sendCode(String phone) { + _prefs.setString(_kPhone, phone); + state = state.copyWith(phone: phone); + return demoCode; + } + + bool verifyCode(String code) { + if (code != demoCode) return false; + _prefs.setBool(_kSignedIn, true); + state = state.copyWith(signedIn: true); + return true; + } + + void grantLocation() { + _prefs.setBool(_kLocation, true); + state = state.copyWith(locationGranted: true); + } + + void grantNotifications() { + _prefs.setBool(_kNotifications, true); + state = state.copyWith(notificationsGranted: true); + } + + void grantCamera() { + _prefs.setBool(_kCamera, true); + state = state.copyWith(cameraGranted: true); + } + + Future signOut() async { + await _prefs.remove(_kSignedIn); + await _prefs.remove(_kPhone); + state = state.copyWith(signedIn: false, phone: ''); + } +} + +final sessionProvider = NotifierProvider( + SessionController.new, +); diff --git a/lib/state/shifts_controller.dart b/lib/state/shifts_controller.dart new file mode 100644 index 0000000..16ac0c9 --- /dev/null +++ b/lib/state/shifts_controller.dart @@ -0,0 +1,172 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../core/formatters.dart'; +import '../models/shift.dart'; +import '../models/timecard.dart'; +import 'seed.dart'; +import 'timecards_controller.dart'; + +class ShiftsController extends Notifier> { + @override + List build() => Seed.shifts(); + + Shift? byId(String id) { + for (final s in state) { + if (s.id == id) return s; + } + return null; + } + + void _replace(Shift updated) { + state = [ + for (final s in state) + if (s.id == updated.id) updated else s, + ]; + } + + /// Accept an open shift. It moves straight into Booked. + void apply(String id) { + final shift = byId(id); + if (shift == null || shift.status != ShiftStatus.open) return; + _replace(shift.copyWith(status: ShiftStatus.booked)); + } + + /// Give a booked shift back. Counts against the cancellation tally. + void cancel(String id) { + final shift = byId(id); + if (shift == null) return; + _replace(shift.copyWith(status: ShiftStatus.cancelled)); + } + + void clockIn(String id) { + final shift = byId(id); + if (shift == null || shift.status != ShiftStatus.booked) return; + _replace( + shift.copyWith(status: ShiftStatus.active, clockIn: DateTime.now()), + ); + } + + /// Clocking out completes the shift and files the timecard automatically. + Timecard? clockOut(String id) { + final shift = byId(id); + if (shift == null || shift.status != ShiftStatus.active) return null; + final now = DateTime.now(); + final done = shift.copyWith(status: ShiftStatus.completed, clockOut: now); + _replace(done); + + final card = Timecard( + id: 'tc-${shift.id}-${now.millisecondsSinceEpoch}', + shiftId: shift.id, + role: shift.role, + business: shift.business, + scheduledStart: shift.start, + scheduledEnd: shift.end, + clockIn: done.clockIn!, + clockOut: now, + breakMinutes: shift.breakMinutes, + rate: shift.rate, + status: TimecardStatus.needsReview, + submittedAt: now, + ); + ref.read(timecardsProvider.notifier).add(card); + return card; + } +} + +final shiftsProvider = NotifierProvider>( + ShiftsController.new, +); + +final bookedShiftsProvider = Provider>((ref) { + final list = + ref + .watch(shiftsProvider) + .where( + (s) => + s.status == ShiftStatus.booked || + s.status == ShiftStatus.active, + ) + .toList() + ..sort((a, b) => a.start.compareTo(b.start)); + return list; +}); + +final openShiftsProvider = Provider>((ref) { + final list = + ref + .watch(shiftsProvider) + .where((s) => s.status == ShiftStatus.open) + .toList() + ..sort((a, b) => b.rate.compareTo(a.rate)); + return list; +}); + +final historyShiftsProvider = Provider>((ref) { + final list = + ref + .watch(shiftsProvider) + .where( + (s) => const { + ShiftStatus.completed, + ShiftStatus.cancelled, + ShiftStatus.noShow, + }.contains(s.status), + ) + .toList() + ..sort((a, b) => b.start.compareTo(a.start)); + return list; +}); + +/// The shift the Today screen leads with: whatever is running now, else the +/// next one on the calendar. +final nextShiftProvider = Provider((ref) { + final booked = ref.watch(bookedShiftsProvider); + for (final s in booked) { + if (s.status == ShiftStatus.active) return s; + } + final now = DateTime.now(); + for (final s in booked) { + if (s.end.isAfter(now)) return s; + } + return booked.isEmpty ? null : booked.first; +}); + +final activeShiftProvider = Provider((ref) { + for (final s in ref.watch(shiftsProvider)) { + if (s.status == ShiftStatus.active) return s; + } + return null; +}); + +/// Gross pay, pre-tax, already banked from completed shifts. +final completedEarningsProvider = Provider((ref) { + return ref + .watch(shiftsProvider) + .where((s) => s.status == ShiftStatus.completed) + .fold(0, (sum, s) => sum + s.pay); +}); + +final hoursLoggedProvider = Provider((ref) { + return ref + .watch(shiftsProvider) + .where((s) => s.status == ShiftStatus.completed) + .fold( + Duration.zero, + (sum, s) => sum + (s.workedDuration ?? Duration.zero), + ); +}); + +/// Booked but not yet worked: the money still coming. +final scheduledEarningsProvider = Provider((ref) { + return ref + .watch(bookedShiftsProvider) + .fold(0, (sum, s) => sum + s.scheduledPay); +}); + +/// Shifts falling on a given calendar day, used by the week strip. +final shiftsOnDayProvider = Provider.family, DateTime>((ref, day) { + return ref + .watch(bookedShiftsProvider) + .where((s) => Fmt.sameDay(s.start, day)) + .toList(); +}); diff --git a/lib/state/timecards_controller.dart b/lib/state/timecards_controller.dart new file mode 100644 index 0000000..dced0e8 --- /dev/null +++ b/lib/state/timecards_controller.dart @@ -0,0 +1,49 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +import '../models/timecard.dart'; +import 'seed.dart'; + +class TimecardsController extends Notifier> { + @override + List build() => Seed.timecards(); + + void add(Timecard card) { + state = [card, ...state]; + } + + void approve(String id) { + state = [ + for (final t in state) + if (t.id == id) t.copyWith(status: TimecardStatus.approved) else t, + ]; + } + + void dispute(String id, String note) { + state = [ + for (final t in state) + if (t.id == id) + t.copyWith(status: TimecardStatus.disputed, disputeNote: note) + else + t, + ]; + } + + Timecard? byId(String id) { + for (final t in state) { + if (t.id == id) return t; + } + return null; + } +} + +final timecardsProvider = NotifierProvider>( + TimecardsController.new, +); + +/// Timecards still waiting on the worker to confirm or dispute. +final timecardsNeedingReviewProvider = Provider>((ref) { + return ref + .watch(timecardsProvider) + .where((t) => t.status == TimecardStatus.needsReview) + .toList(); +}); diff --git a/lib/widgets/collapsing_header.dart b/lib/widgets/collapsing_header.dart new file mode 100644 index 0000000..959ec3e --- /dev/null +++ b/lib/widgets/collapsing_header.dart @@ -0,0 +1,137 @@ +import 'package:flutter/material.dart'; + +import 'common.dart'; + +/// Builds header content for a given collapse progress: 0 fully open, 1 fully +/// collapsed. +typedef CollapsingHeaderBuilder = + Widget Function(BuildContext context, double t); + +/// The pinned brand header used by the main tabs. +/// +/// It stays on screen while the content scrolls beneath it, and shrinks from +/// [expandedHeight] to [collapsedHeight] on the way. Pinning a tall header at +/// full size would cost a quarter of a phone screen for the whole session; +/// collapsing keeps the context and gives the space back. +class KrowSliverHeader extends StatelessWidget { + const KrowSliverHeader({ + super.key, + required this.expandedHeight, + required this.collapsedHeight, + required this.builder, + }); + + /// Heights exclude the status bar, which is added for you. + final double expandedHeight; + final double collapsedHeight; + final CollapsingHeaderBuilder builder; + + @override + Widget build(BuildContext context) { + final top = MediaQuery.paddingOf(context).top; + return SliverPersistentHeader( + pinned: true, + delegate: _HeaderDelegate( + minHeight: collapsedHeight + top, + maxHeight: expandedHeight + top, + topInset: top, + builder: builder, + ), + ); + } +} + +class _HeaderDelegate extends SliverPersistentHeaderDelegate { + _HeaderDelegate({ + required this.minHeight, + required this.maxHeight, + required this.topInset, + required this.builder, + }); + + final double minHeight; + final double maxHeight; + final double topInset; + final CollapsingHeaderBuilder builder; + + @override + double get minExtent => minHeight; + + @override + double get maxExtent => maxHeight; + + @override + Widget build(BuildContext context, double shrinkOffset, bool overlaps) { + final range = maxHeight - minHeight; + final t = range <= 0 ? 1.0 : (shrinkOffset / range).clamp(0.0, 1.0); + return BrandSurface( + child: Padding( + padding: EdgeInsets.only(top: topInset), + child: builder(context, t), + ), + ); + } + + @override + bool shouldRebuild(_HeaderDelegate old) => + old.minHeight != minHeight || + old.maxHeight != maxHeight || + old.topInset != topInset || + old.builder != builder; +} + +/// Cross-fades a header between its open and collapsed states. +/// +/// The open content keeps its natural size and is clipped as the header +/// shrinks — letting it compress instead would squash the type on the way +/// down, and would overflow before it finished fading. +class HeaderCrossFade extends StatelessWidget { + const HeaderCrossFade({ + super.key, + required this.t, + required this.expandedHeight, + required this.expanded, + required this.collapsed, + }); + + final double t; + final double expandedHeight; + final Widget expanded; + final Widget collapsed; + + @override + Widget build(BuildContext context) { + // The open state clears out over the first two thirds; the collapsed bar + // arrives over the last half. They overlap briefly, which reads as one + // state becoming the other rather than a swap. + final openOpacity = (1 - t * 1.5).clamp(0.0, 1.0); + final shutOpacity = ((t - 0.5) * 2).clamp(0.0, 1.0); + + return Stack( + fit: StackFit.expand, + children: [ + if (openOpacity > 0) + ClipRect( + child: OverflowBox( + alignment: Alignment.topCenter, + minHeight: 0, + // Unbounded, so content taller than the header lays out at its + // natural size and is clipped. Capping it here instead would + // throw a layout overflow — and one only visible in a debug + // build, so it reaches a device before it reaches you. + maxHeight: double.infinity, + child: Opacity( + opacity: openOpacity, + child: IgnorePointer(ignoring: t > 0.5, child: expanded), + ), + ), + ), + if (shutOpacity > 0) + Opacity( + opacity: shutOpacity, + child: IgnorePointer(ignoring: t < 0.5, child: collapsed), + ), + ], + ); + } +} diff --git a/lib/widgets/common.dart b/lib/widgets/common.dart new file mode 100644 index 0000000..c7d70e2 --- /dev/null +++ b/lib/widgets/common.dart @@ -0,0 +1,835 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/theme.dart'; + +/// Small uppercase section heading used above every group of cards. +class SectionLabel extends StatelessWidget { + const SectionLabel(this.text, {super.key, this.trailing}); + + final String text; + final Widget? trailing; + + @override + Widget build(BuildContext context) { + // No horizontal inset: the label has to share a left edge with the cards + // and body copy it sits above. + return Padding( + padding: const EdgeInsets.fromLTRB(0, 22, 0, 10), + child: Row( + children: [ + Expanded( + child: Text( + text.toUpperCase(), + style: const TextStyle( + fontSize: 10.5, + fontWeight: FontWeight.w600, + letterSpacing: 1.4, + color: Color(0xFF949FA5), + ), + ), + ), + ?trailing, + ], + ), + ); + } +} + +enum ChipTone { blue, yellow, neutral, muted, danger } + +/// Status pill. Yellow marks anything waiting on the worker. +class StatusChip extends StatelessWidget { + const StatusChip( + this.label, { + super.key, + this.tone = ChipTone.neutral, + this.icon, + }); + + final String label; + final ChipTone tone; + final IconData? icon; + + @override + Widget build(BuildContext context) { + final (bg, fg) = switch (tone) { + ChipTone.blue => (KrowPalette.blueTint, KrowPalette.blue), + ChipTone.yellow => (KrowPalette.yellow, KrowPalette.ink), + ChipTone.neutral => (const Color(0xFFDEEBE2), KrowPalette.ink), + ChipTone.muted => (const Color(0xFFDEEBE2), const Color(0xFF65727A)), + ChipTone.danger => (const Color(0xFFFBE3E3), const Color(0xFFA6403F)), + }; + return Container( + padding: EdgeInsets.fromLTRB(icon == null ? 10 : 8, 6, 10, 6), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(9), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + if (icon != null) ...[ + Icon(icon, size: 13, color: fg), + const SizedBox(width: 5), + ], + // Flexible so the chip gives way when the row it sits in runs out of + // width — at a large text scale it otherwise overflows its parent. + Flexible( + child: Text( + label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w600, + color: fg, + ), + ), + ), + ], + ), + ); + } +} + +/// Soft informational panel. `warning: true` switches it to the yellow tone. +class InfoBanner extends StatelessWidget { + const InfoBanner(this.text, {super.key, this.warning = false, this.icon}); + + final String text; + final bool warning; + final IconData? icon; + + @override + Widget build(BuildContext context) { + final bg = warning ? const Color(0xFFF7E4AE) : KrowPalette.blueTint; + final fg = warning ? KrowPalette.ink : KrowPalette.blueDeep; + return Container( + padding: const EdgeInsets.all(14), + decoration: BoxDecoration( + color: bg, + borderRadius: BorderRadius.circular(12), + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon( + icon ?? (warning ? LucideIcons.triangleAlert : LucideIcons.info), + size: 16, + color: fg, + ), + const SizedBox(width: 11), + Expanded( + child: Text( + text, + style: TextStyle(fontSize: 12.5, height: 1.5, color: fg), + ), + ), + ], + ), + ); + } +} + +/// White rounded container used for every grouped block. +class KrowCard extends StatelessWidget { + const KrowCard({ + super.key, + required this.child, + this.padding = const EdgeInsets.all(16), + this.onTap, + this.dashed = false, + }); + + final Widget child; + final EdgeInsetsGeometry padding; + final VoidCallback? onTap; + final bool dashed; + + @override + Widget build(BuildContext context) { + return Material( + color: dashed ? Colors.transparent : Colors.white, + borderRadius: BorderRadius.circular(16), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(16), + child: Container( + padding: padding, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all(color: KrowPalette.line), + ), + child: child, + ), + ), + ); + } +} + +/// A navigation row: icon tile, title, subtitle, optional badge, chevron. +class NavTile extends StatelessWidget { + const NavTile({ + super.key, + required this.icon, + required this.title, + this.subtitle, + this.badge, + this.onTap, + }); + + final IconData icon; + final String title; + final String? subtitle; + final Widget? badge; + final VoidCallback? onTap; + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 14), + child: Row( + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: KrowPalette.blueTint, + borderRadius: BorderRadius.circular(11), + ), + child: Icon(icon, size: 18, color: KrowPalette.blue), + ), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: const TextStyle( + fontSize: 14.5, + fontWeight: FontWeight.w600, + ), + ), + if (subtitle != null) + Padding( + padding: const EdgeInsets.only(top: 2), + child: Text( + subtitle!, + style: const TextStyle( + fontSize: 12, + height: 1.35, + color: KrowPalette.mute, + ), + ), + ), + ], + ), + ), + if (badge != null) ...[const SizedBox(width: 8), badge!], + const SizedBox(width: 8), + const Icon( + LucideIcons.chevronRight, + size: 17, + color: Color(0xFF949FA5), + ), + ], + ), + ), + ); + } +} + +/// Groups NavTiles into a single card with hairline dividers between rows. +class TileGroup extends StatelessWidget { + const TileGroup({super.key, required this.children}); + + final List children; + + @override + Widget build(BuildContext context) { + return KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + children: [ + for (var i = 0; i < children.length; i++) ...[ + if (i > 0) const Divider(height: 1), + children[i], + ], + ], + ), + ); + } +} + +/// Dotted-leader row: label on the left, value on the right. +class DetailRow extends StatelessWidget { + const DetailRow( + this.label, + this.value, { + super.key, + this.emphasis = false, + this.valueColor, + }); + + final String label; + final String value; + final bool emphasis; + final Color? valueColor; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 11), + child: Row( + crossAxisAlignment: CrossAxisAlignment.baseline, + textBaseline: TextBaseline.alphabetic, + children: [ + Expanded( + child: Text( + label, + style: TextStyle( + fontSize: 13.5, + fontWeight: emphasis ? FontWeight.w600 : FontWeight.w400, + ), + ), + ), + const SizedBox(width: 12), + Text( + value, + style: TextStyle( + fontSize: emphasis ? 16 : 13.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.3, + color: valueColor ?? KrowPalette.ink, + ), + ), + ], + ), + ); + } +} + +/// Three-up figure block: caption over a big number. +/// +/// Both lines are pinned to a fixed height and scale down instead of wrapping. +/// A wrapping caption or figure — "CLOCK OUT", "11:50 PM" — would make one +/// card taller than the two beside it and leave the row ragged. +class StatSlab extends StatelessWidget { + const StatSlab(this.caption, this.value, {super.key, this.valueColor}); + + final String caption; + final String value; + final Color? valueColor; + + static const _captionHeight = 13.0; + static const _valueHeight = 25.0; + + @override + Widget build(BuildContext context) { + return KrowCard( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 13), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox( + height: _captionHeight, + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + caption.toUpperCase(), + maxLines: 1, + style: const TextStyle( + fontSize: 9, + fontWeight: FontWeight.w600, + letterSpacing: 1.2, + color: Color(0xFF949FA5), + ), + ), + ), + ), + const SizedBox(height: 6), + SizedBox( + height: _valueHeight, + child: FittedBox( + fit: BoxFit.scaleDown, + alignment: Alignment.centerLeft, + child: Text( + value, + maxLines: 1, + style: TextStyle( + fontSize: 17.5, + fontWeight: FontWeight.w700, + letterSpacing: -0.6, + color: valueColor ?? KrowPalette.ink, + ), + ), + ), + ), + ], + ), + ); + } +} + +/// Lays out slabs as an evenly spaced row of equal-height cards. +class StatSlabRow extends StatelessWidget { + const StatSlabRow({super.key, required this.slabs}); + + final List slabs; + + @override + Widget build(BuildContext context) { + // These rows live inside scrollables, where the height is unbounded, so + // `stretch` alone would try to fill infinity. IntrinsicHeight gives the + // row the height of its tallest card first, and stretch then matches the + // others to it. + return IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + for (var i = 0; i < slabs.length; i++) ...[ + if (i > 0) const SizedBox(width: 9), + Expanded(child: slabs[i]), + ], + ], + ), + ); + } +} + +/// Horizontal rail of small stats, divided by hairlines. +class StatRail extends StatelessWidget { + const StatRail({super.key, required this.stats}); + + final List<(String, String)> stats; + + @override + Widget build(BuildContext context) { + return KrowCard( + padding: EdgeInsets.zero, + child: IntrinsicHeight( + child: Row( + children: [ + for (var i = 0; i < stats.length; i++) ...[ + if (i > 0) const VerticalDivider(width: 1), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 14), + child: Column( + children: [ + Text( + stats[i].$2, + style: const TextStyle( + fontSize: 15, + fontWeight: FontWeight.w700, + letterSpacing: -0.4, + ), + ), + const SizedBox(height: 4), + Text( + stats[i].$1.toUpperCase(), + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 8.5, + fontWeight: FontWeight.w600, + letterSpacing: 0.6, + color: Color(0xFF949FA5), + ), + ), + ], + ), + ), + ), + ], + ], + ), + ), + ); + } +} + +/// Progress that grows into place rather than snapping, so a change — an +/// uploaded document, a day worked — is something you see happen. +class KrowProgressBar extends StatelessWidget { + const KrowProgressBar(this.value, {super.key, this.color}); + + final double value; + final Color? color; + + @override + Widget build(BuildContext context) { + return TweenAnimationBuilder( + tween: Tween(end: value.clamp(0, 1)), + duration: const Duration(milliseconds: 600), + curve: Curves.easeOutCubic, + builder: (context, animated, _) => ClipRRect( + borderRadius: BorderRadius.circular(3), + child: LinearProgressIndicator( + value: animated, + minHeight: 6, + backgroundColor: KrowPalette.line, + valueColor: AlwaysStoppedAnimation(color ?? KrowPalette.blue), + ), + ), + ); + } +} + +class EmptyState extends StatelessWidget { + const EmptyState({ + super.key, + required this.icon, + required this.title, + required this.message, + this.action, + }); + + final IconData icon; + final String title; + final String message; + final Widget? action; + + @override + Widget build(BuildContext context) { + return Container( + width: double.infinity, + padding: const EdgeInsets.symmetric(horizontal: 22, vertical: 34), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16), + border: Border.all(color: KrowPalette.line, style: BorderStyle.solid), + ), + child: Column( + children: [ + Container( + width: 56, + height: 56, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.all(color: KrowPalette.line), + ), + child: Icon(icon, size: 24, color: const Color(0xFF949FA5)), + ), + const SizedBox(height: 14), + Text( + title, + textAlign: TextAlign.center, + style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w700), + ), + const SizedBox(height: 5), + Text( + message, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 13, + height: 1.5, + color: KrowPalette.mute, + ), + ), + if (action != null) ...[const SizedBox(height: 16), action!], + ], + ), + ); + } +} + +/// Business identity tile used on every shift card. +class BusinessBadge extends StatelessWidget { + const BusinessBadge(this.letter, {super.key, this.size = 46}); + + final String letter; + final double size; + + @override + Widget build(BuildContext context) { + return Container( + width: size, + height: size, + alignment: Alignment.center, + decoration: BoxDecoration( + color: KrowPalette.blue, + borderRadius: BorderRadius.circular(size / 3.2), + ), + child: Text( + letter, + style: TextStyle( + fontSize: size * 0.42, + fontWeight: FontWeight.w800, + color: Colors.white, + ), + ), + ); + } +} + +/// Small icon + text pair used for shift metadata. +class MetaPill extends StatelessWidget { + const MetaPill(this.icon, this.text, {super.key}); + + final IconData icon; + final String text; + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6), + decoration: BoxDecoration( + color: const Color(0x0F26353E), + borderRadius: BorderRadius.circular(9), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(icon, size: 12, color: const Color(0xFF949FA5)), + const SizedBox(width: 6), + Flexible( + child: Text( + text, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ), + ); + } +} + +/// The blue ground every header sits on: brand colour, rounded bottom, and two +/// soft glows. The glows are quiet on their own, but they give the frosted +/// controls sitting on top something to refract. +class BrandSurface extends StatelessWidget { + const BrandSurface({super.key, required this.child}); + + final Widget child; + + @override + Widget build(BuildContext context) { + return ClipRRect( + borderRadius: const BorderRadius.vertical(bottom: Radius.circular(16)), + child: Container( + width: double.infinity, + color: KrowPalette.blue, + child: Stack( + children: [ + Positioned( + top: -70, + right: -40, + child: _Glow(220, Colors.white.withValues(alpha: 0.16)), + ), + Positioned( + bottom: -90, + left: -50, + child: _Glow(240, KrowPalette.yellow.withValues(alpha: 0.14)), + ), + child, + ], + ), + ), + ); + } +} + +/// The blue header block that tops a pushed detail screen. Main tabs use +/// KrowSliverHeader instead, so their header stays put while content scrolls. +class BrandHeader extends StatelessWidget { + const BrandHeader({ + super.key, + required this.child, + this.padding = const EdgeInsets.fromLTRB(20, 8, 20, 24), + }); + + final Widget child; + final EdgeInsetsGeometry padding; + + @override + Widget build(BuildContext context) { + return BrandSurface( + child: SafeArea( + bottom: false, + child: Padding(padding: padding, child: child), + ), + ); + } +} + +/// A soft circular bloom. Drawn as a radial gradient rather than a blurred +/// shape, which costs nothing per frame. +class _Glow extends StatelessWidget { + const _Glow(this.size, this.color); + + final double size; + final Color color; + + @override + Widget build(BuildContext context) { + return IgnorePointer( + child: Container( + width: size, + height: size, + decoration: BoxDecoration( + shape: BoxShape.circle, + gradient: RadialGradient(colors: [color, color.withValues(alpha: 0)]), + ), + ), + ); + } +} + +/// Round icon button used in headers, on light or dark ground. +class HeaderIconButton extends StatelessWidget { + const HeaderIconButton({ + super.key, + required this.icon, + required this.onPressed, + this.onDark = true, + this.tooltip, + }); + + final IconData icon; + final VoidCallback onPressed; + final bool onDark; + final String? tooltip; + + @override + Widget build(BuildContext context) { + return Material( + color: onDark ? Colors.white24 : Colors.white, + borderRadius: BorderRadius.circular(11), + child: InkWell( + onTap: onPressed, + borderRadius: BorderRadius.circular(11), + child: Tooltip( + message: tooltip ?? '', + child: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(11), + border: onDark ? null : Border.all(color: KrowPalette.line), + ), + child: Icon( + icon, + size: 19, + color: onDark ? Colors.white : KrowPalette.ink, + ), + ), + ), + ), + ); + } +} + +/// Simple bar chart used on the earnings screens. +class MiniBarChart extends StatelessWidget { + const MiniBarChart({super.key, required this.bars}); + + /// `(label, value, isPaid)` — paid bars read blue, pending read yellow. + final List<(String, double, bool)> bars; + + @override + Widget build(BuildContext context) { + final max = bars.fold(0, (m, b) => b.$2 > m ? b.$2 : m); + return Column( + children: [ + SizedBox( + height: 118, + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + for (final bar in bars) + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 6), + // Bars grow to their new height when the range changes, + // so you can see which column moved. + child: TweenAnimationBuilder( + tween: Tween( + end: max == 0 + ? 0.0 + : (bar.$2 / max).clamp(0.0, 1.0).toDouble(), + ), + duration: const Duration(milliseconds: 520), + curve: Curves.easeOutCubic, + builder: (context, height, _) => FractionallySizedBox( + heightFactor: height, + child: TweenAnimationBuilder( + tween: ColorTween( + end: bar.$3 ? KrowPalette.blue : KrowPalette.yellow, + ), + duration: const Duration(milliseconds: 320), + builder: (context, color, _) => Container( + decoration: BoxDecoration( + color: color, + borderRadius: const BorderRadius.vertical( + top: Radius.circular(6), + bottom: Radius.circular(3), + ), + ), + ), + ), + ), + ), + ), + ), + ], + ), + ), + const SizedBox(height: 9), + Row( + children: [ + for (final bar in bars) + Expanded( + child: Text( + bar.$1, + textAlign: TextAlign.center, + style: const TextStyle( + fontSize: 9.5, + fontWeight: FontWeight.w500, + color: Color(0xFF949FA5), + ), + ), + ), + ], + ), + ], + ); + } +} + +/// Legend dot + label, paired with the chart. +class LegendDot extends StatelessWidget { + const LegendDot(this.color, this.label, {super.key}); + + final Color color; + final String label; + + @override + Widget build(BuildContext context) { + return Row( + mainAxisSize: MainAxisSize.min, + children: [ + Container( + width: 8, + height: 8, + decoration: BoxDecoration(color: color, shape: BoxShape.circle), + ), + const SizedBox(width: 6), + Text( + label, + style: const TextStyle(fontSize: 12, color: KrowPalette.mute), + ), + ], + ); + } +} diff --git a/lib/widgets/glass_segments.dart b/lib/widgets/glass_segments.dart new file mode 100644 index 0000000..5e8641c --- /dev/null +++ b/lib/widgets/glass_segments.dart @@ -0,0 +1,191 @@ +import 'dart:ui'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import '../core/theme.dart'; + +/// A frosted-glass segmented control for use on the brand header. +/// +/// The track is translucent and blurs whatever sits behind it, with a bright +/// top edge and a darker bottom edge so it reads as a pane of glass rather +/// than a flat tint. The selected segment is a brighter frosted pill that +/// slides between positions. +class GlassSegments extends StatelessWidget { + const GlassSegments({ + super.key, + required this.segments, + required this.value, + required this.onChanged, + this.height = 44, + }); + + /// Each segment as `(value, label)`. + final List<(T, String)> segments; + final T value; + final ValueChanged onChanged; + final double height; + + static const _radius = 15.0; + static const _pad = 4.0; + + @override + Widget build(BuildContext context) { + final index = segments.indexWhere((s) => s.$1 == value); + + return SizedBox( + height: height, + child: ClipRRect( + borderRadius: BorderRadius.circular(_radius), + child: BackdropFilter( + filter: ImageFilter.blur(sigmaX: 16, sigmaY: 16), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(_radius), + // Light falling across the pane: brighter at the top edge. + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Colors.white.withValues(alpha: 0.26), + Colors.white.withValues(alpha: 0.12), + ], + ), + border: Border.all( + color: Colors.white.withValues(alpha: 0.28), + width: 1, + ), + ), + padding: const EdgeInsets.all(_pad), + child: LayoutBuilder( + builder: (context, constraints) { + final segmentWidth = constraints.maxWidth / segments.length; + + // One animation drives everything: the pill's position, its + // stretch, and each label's colour. Animating the selected + // index as a double — rather than moving the pill and flipping + // the labels separately — is what makes the labels light up + // exactly as the pill arrives over them. Retargeting mid-flight + // continues from wherever the pill currently is. + return TweenAnimationBuilder( + tween: Tween(end: index.toDouble()), + duration: const Duration(milliseconds: 340), + curve: Curves.easeOutQuint, + builder: (context, position, _) { + // Squash and stretch: the pill widens at speed and settles + // back to size as it lands. + final travel = (position - position.roundToDouble()).abs(); + final stretch = segmentWidth * 0.12 * (travel * 2); + + return Stack( + children: [ + if (index >= 0) + Positioned( + left: position * segmentWidth - stretch / 2, + width: segmentWidth + stretch, + top: 0, + bottom: 0, + child: const _SelectedPill(), + ), + Row( + children: [ + for (var i = 0; i < segments.length; i++) + Expanded( + child: _Segment( + label: segments[i].$2, + // 1 when the pill is centred on this label, + // 0 once it has moved a full segment away. + selectedAmount: (1 - (position - i).abs()) + .clamp(0.0, 1.0), + onTap: () { + if (segments[i].$1 == value) return; + HapticFeedback.selectionClick(); + onChanged(segments[i].$1); + }, + ), + ), + ], + ), + ], + ); + }, + ); + }, + ), + ), + ), + ), + ); + } +} + +class _SelectedPill extends StatelessWidget { + const _SelectedPill(); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(11), + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Colors.white.withValues(alpha: 0.96), + Colors.white.withValues(alpha: 0.86), + ], + ), + border: Border.all(color: Colors.white.withValues(alpha: 0.9)), + boxShadow: [ + BoxShadow( + color: KrowPalette.blueDeep.withValues(alpha: 0.28), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ], + ), + ); + } +} + +class _Segment extends StatelessWidget { + const _Segment({ + required this.label, + required this.selectedAmount, + required this.onTap, + }); + + final String label; + + /// How far the travelling pill has arrived over this label, 0 to 1. + final double selectedAmount; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + return GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: onTap, + child: Center( + child: Text( + label, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 12.5, + // Weight is snapped to the nearest real weight; the eye reads the + // colour ramp as the smooth part. + fontWeight: selectedAmount > 0.5 + ? FontWeight.w700 + : FontWeight.w600, + color: Color.lerp( + Colors.white.withValues(alpha: 0.82), + KrowPalette.blue, + Curves.easeIn.transform(selectedAmount), + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/krow_nav_bar.dart b/lib/widgets/krow_nav_bar.dart new file mode 100644 index 0000000..e9d7af9 --- /dev/null +++ b/lib/widgets/krow_nav_bar.dart @@ -0,0 +1,215 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import '../core/theme.dart'; + +class KrowNavItem { + const KrowNavItem({ + required this.icon, + required this.label, + this.showDot = false, + }); + + final IconData icon; + final String label; + + /// Marks the tab as needing attention, without saying how much. + final bool showDot; +} + +/// Bottom navigation whose indicator slides between tabs. +/// +/// Material's own [NavigationBar] fades its indicator in at the destination +/// and out at the origin, so the selection appears to teleport. Here the pill +/// travels, and the icons hand it over as it passes. +class KrowNavBar extends StatelessWidget { + const KrowNavBar({ + super.key, + required this.items, + required this.currentIndex, + required this.onSelect, + }); + + final List items; + final int currentIndex; + final ValueChanged onSelect; + + static const _pillWidth = 58.0; + static const _pillHeight = 32.0; + + /// Breathing room between the bar's top edge and the icons. The pill and the + /// icons both start here, which is also what keeps them aligned — centring + /// the icons while pinning the pill to a fixed offset left the two a couple + /// of pixels apart. + static const _topPadding = 12.0; + + /// Lets tests find the travelling indicator unambiguously. + static const indicatorKey = ValueKey('krow-nav-indicator'); + + @override + Widget build(BuildContext context) { + return Container( + decoration: const BoxDecoration( + color: Colors.white, + border: Border(top: BorderSide(color: KrowPalette.line)), + ), + child: SafeArea( + top: false, + child: SizedBox( + height: 76, + child: LayoutBuilder( + builder: (context, constraints) { + final slot = constraints.maxWidth / items.length; + + // The selected index animated as a double, so the pill's + // position and every icon's colour come from one value. + return TweenAnimationBuilder( + tween: Tween(end: currentIndex.toDouble()), + duration: const Duration(milliseconds: 360), + curve: Curves.easeOutQuint, + builder: (context, position, _) { + final travel = (position - position.roundToDouble()).abs(); + final stretch = 20 * (travel * 2); + + return Stack( + children: [ + Positioned( + left: + position * slot + + (slot - _pillWidth) / 2 - + stretch / 2, + top: _topPadding, + width: _pillWidth + stretch, + height: _pillHeight, + child: DecoratedBox( + key: indicatorKey, + decoration: BoxDecoration( + color: KrowPalette.blue, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: KrowPalette.blue.withValues(alpha: 0.28), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ], + ), + ), + ), + Row( + children: [ + for (var i = 0; i < items.length; i++) + Expanded( + child: _NavItem( + item: items[i], + // 1 when the pill is centred on this tab. + proximity: (1 - (position - i).abs()).clamp( + 0.0, + 1.0, + ), + onTap: () { + if (i != currentIndex) { + HapticFeedback.selectionClick(); + } + onSelect(i); + }, + ), + ), + ], + ), + ], + ); + }, + ); + }, + ), + ), + ), + ); + } +} + +class _NavItem extends StatelessWidget { + const _NavItem({ + required this.item, + required this.proximity, + required this.onTap, + }); + + final KrowNavItem item; + final double proximity; + final VoidCallback onTap; + + @override + Widget build(BuildContext context) { + // The icon only turns white once the pill is actually under it — a linear + // ramp would leave it half-white over bare white while the pill is still + // in transit. easeInCubic holds it grey, then flips on arrival. + final onPill = Curves.easeInCubic.transform(proximity); + final iconColor = Color.lerp(KrowPalette.mute, Colors.white, onPill)!; + // The label is never covered, so it can ramp gently the whole way. + final labelColor = Color.lerp( + KrowPalette.mute, + KrowPalette.blue, + Curves.easeIn.transform(proximity), + )!; + + // Material's NavigationBar announces each tab and its selected state; + // rolling our own means saying so explicitly. container + excludeSemantics + // collapse the icon, dot and label into a single node — otherwise the + // annotation is split across the children and never reaches the reader. + return Semantics( + container: true, + excludeSemantics: true, + button: true, + selected: proximity > 0.5, + label: item.showDot ? '${item.label}, needs attention' : item.label, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: onTap, + child: Column( + // Started from the top rather than centred, so the icon sits exactly + // where the pill is drawn. + mainAxisAlignment: MainAxisAlignment.start, + children: [ + const SizedBox(height: KrowNavBar._topPadding), + SizedBox( + height: KrowNavBar._pillHeight, + child: Center(child: Icon(item.icon, size: 21, color: iconColor)), + ), + const SizedBox(height: 3), + // The dot's slot is always reserved, so tabs with and without one + // keep their labels on the same line. + SizedBox( + height: 6, + child: Center( + child: AnimatedScale( + scale: item.showDot ? 1 : 0, + duration: const Duration(milliseconds: 220), + curve: Curves.easeOutBack, + child: Container( + width: 6, + height: 6, + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.error, + shape: BoxShape.circle, + ), + ), + ), + ), + ), + const SizedBox(height: 2), + Text( + item.label, + style: TextStyle( + fontSize: 11, + fontWeight: proximity > 0.5 ? FontWeight.w600 : FontWeight.w500, + color: labelColor, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/shift_card.dart b/lib/widgets/shift_card.dart new file mode 100644 index 0000000..b894258 --- /dev/null +++ b/lib/widgets/shift_card.dart @@ -0,0 +1,170 @@ +import 'package:flutter/material.dart'; +import 'package:lucide_icons_flutter/lucide_icons.dart'; + +import '../core/formatters.dart'; +import '../core/theme.dart'; +import '../models/shift.dart'; +import 'common.dart'; + +/// The one card shape in the app. Identity on top, a hairline split, then the +/// money band — with a status bar welded to the bottom edge. +class ShiftCard extends StatelessWidget { + const ShiftCard({ + super.key, + required this.shift, + this.onTap, + this.trailingAction, + this.showDate = false, + }); + + final Shift shift; + final VoidCallback? onTap; + + /// Optional action shown in the money band, e.g. an Apply button. + final Widget? trailingAction; + final bool showDate; + + (String, ChipTone) get _status => switch (shift.status) { + ShiftStatus.open => ('Open', ChipTone.blue), + ShiftStatus.booked => (Fmt.untilStart(shift.start), ChipTone.yellow), + ShiftStatus.active => ('On shift', ChipTone.yellow), + ShiftStatus.completed => ('Completed', ChipTone.neutral), + ShiftStatus.cancelled => ('Cancelled', ChipTone.muted), + ShiftStatus.noShow => ('No show', ChipTone.danger), + }; + + Color get _railColor => switch (shift.status) { + ShiftStatus.active => KrowPalette.yellow, + ShiftStatus.cancelled || ShiftStatus.noShow => const Color(0xFFCFDDD3), + _ => KrowPalette.blue, + }; + + @override + Widget build(BuildContext context) { + final (statusLabel, statusTone) = _status; + final unpaid = + shift.status == ShiftStatus.cancelled || + shift.status == ShiftStatus.noShow; + + return Material( + color: Colors.white, + borderRadius: BorderRadius.circular(18), + child: InkWell( + onTap: onTap, + borderRadius: BorderRadius.circular(18), + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(18), + border: Border.all(color: KrowPalette.line), + ), + clipBehavior: Clip.antiAlias, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 14), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BusinessBadge(shift.logoLetter), + const SizedBox(width: 13), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + shift.role, + style: const TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + letterSpacing: -0.5, + height: 1.15, + ), + ), + const SizedBox(height: 3), + Text( + shift.venue, + maxLines: 1, + overflow: TextOverflow.ellipsis, + style: const TextStyle( + fontSize: 12.5, + color: KrowPalette.mute, + ), + ), + ], + ), + ), + const SizedBox(width: 8), + StatusChip(statusLabel, tone: statusTone), + ], + ), + const SizedBox(height: 12), + Wrap( + spacing: 7, + runSpacing: 7, + children: [ + if (showDate) + MetaPill( + LucideIcons.calendar, + Fmt.dayShort(shift.start), + ), + MetaPill( + LucideIcons.clock, + Fmt.window(shift.start, shift.end), + ), + MetaPill( + LucideIcons.mapPin, + '${shift.distanceMiles} mi', + ), + ], + ), + ], + ), + ), + const Divider(height: 1), + Padding( + padding: const EdgeInsets.fromLTRB(16, 12, 16, 12), + child: Row( + children: [ + Expanded( + child: Text( + unpaid + ? 'No pay generated' + : '${Fmt.money(shift.rate)}/hr · ' + '${Fmt.duration(shift.scheduledDuration)}', + style: const TextStyle( + fontSize: 11.5, + fontWeight: FontWeight.w600, + letterSpacing: 0.2, + color: Color(0xFF949FA5), + ), + ), + ), + if (trailingAction != null) + trailingAction! + else + Text( + Fmt.money(shift.pay), + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w700, + letterSpacing: -0.7, + color: unpaid + ? const Color(0xFF949FA5) + : KrowPalette.ink, + ), + ), + ], + ), + ), + Container(height: 4, color: _railColor), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/week_strip.dart b/lib/widgets/week_strip.dart new file mode 100644 index 0000000..018878c --- /dev/null +++ b/lib/widgets/week_strip.dart @@ -0,0 +1,143 @@ +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +import '../core/theme.dart'; + +/// Seven-day selector. A dot under a day marks something booked or set. +class WeekStrip extends StatelessWidget { + const WeekStrip({ + super.key, + required this.days, + required this.selected, + required this.onSelect, + this.marked = const {}, + }); + + final List days; + final DateTime selected; + final ValueChanged onSelect; + + /// Day indices (0..6) that carry a marker dot. + final Set marked; + + @override + Widget build(BuildContext context) { + final dow = DateFormat('EEE'); + return Row( + children: [ + for (var i = 0; i < days.length; i++) ...[ + if (i > 0) const SizedBox(width: 7), + Expanded( + child: _DayCell( + day: days[i], + label: dow.format(days[i]), + selected: + days[i].day == selected.day && + days[i].month == selected.month, + marked: marked.contains(i), + onTap: () => onSelect(days[i]), + ), + ), + ], + ], + ); + } +} + +class _DayCell extends StatelessWidget { + const _DayCell({ + required this.day, + required this.label, + required this.selected, + required this.marked, + required this.onTap, + }); + + final DateTime day; + final String label; + final bool selected; + final bool marked; + final VoidCallback onTap; + + static const _duration = Duration(milliseconds: 260); + static const _curve = Curves.easeOutCubic; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: onTap, + // Colour is animated rather than swapped so moving along the week reads + // as one continuous selection rather than a series of flashes. + child: AnimatedContainer( + duration: _duration, + curve: _curve, + height: 64, + decoration: BoxDecoration( + color: selected ? KrowPalette.blue : Colors.white, + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: selected ? KrowPalette.blue : KrowPalette.line, + ), + boxShadow: selected + ? [ + BoxShadow( + color: KrowPalette.blue.withValues(alpha: 0.26), + blurRadius: 12, + offset: const Offset(0, 4), + ), + ] + : null, + ), + child: Stack( + alignment: Alignment.center, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AnimatedDefaultTextStyle( + duration: _duration, + curve: _curve, + style: TextStyle( + fontSize: 9, + fontWeight: FontWeight.w600, + letterSpacing: 0.8, + color: selected ? Colors.white70 : const Color(0xFF949FA5), + ), + child: Text(label.toUpperCase()), + ), + const SizedBox(height: 2), + AnimatedDefaultTextStyle( + duration: _duration, + curve: _curve, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w700, + color: selected ? Colors.white : KrowPalette.ink, + ), + child: Text('${day.day}'), + ), + ], + ), + Positioned( + bottom: 8, + child: AnimatedScale( + scale: marked ? 1 : 0, + duration: _duration, + curve: Curves.easeOutBack, + child: AnimatedContainer( + duration: _duration, + width: 5, + height: 5, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: selected ? KrowPalette.yellow : KrowPalette.blue, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..5f09bb8 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,578 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: e2eb0491ba5ddb6177742d2da23904574082139b07c1e33b8503b9f46f3e1a37 + url: "https://pub.dev" + source: hosted + version: "2.13.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + characters: + dependency: transitive + description: + name: characters + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + url: "https://pub.dev" + source: hosted + version: "1.4.1" + clock: + dependency: transitive + description: + name: clock + sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b + url: "https://pub.dev" + source: hosted + version: "1.1.2" + code_assets: + dependency: transitive + description: + name: code_assets + sha256: bf394f466ba9205f1812a0433b392d6af280f155f56651eda7c18cc32ed493b8 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf + url: "https://pub.dev" + source: hosted + version: "3.0.7" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: "41e005c33bd814be4d3096aff55b1908d419fde52ca656c8c47719ec745873cd" + url: "https://pub.dev" + source: hosted + version: "1.0.9" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" + url: "https://pub.dev" + source: hosted + version: "1.3.3" + ffi: + dependency: transitive + description: + name: ffi + sha256: "6d7fd89431262d8f3125e81b50d3847a091d846eafcd4fdb88dd06f36d705a45" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + flutter_riverpod: + dependency: "direct main" + description: + name: flutter_riverpod + sha256: "2b7f9d2a3c730ac1a98221b420cef966b990fca7ab546ede324642ca57a533e3" + url: "https://pub.dev" + source: hosted + version: "3.4.3" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + go_router: + dependency: "direct main" + description: + name: go_router + sha256: d7a3576cb312649eaa51f2356450aed686085fb58fcdebda5b359aa951eef7ea + url: "https://pub.dev" + source: hosted + version: "17.5.0" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: e3cb3ee6b47fd2472c23de6da5744796a4da195137759ddb3fbcc9467b7b3c7d + url: "https://pub.dev" + source: hosted + version: "8.2.1" + hooks: + dependency: transitive + description: + name: hooks + sha256: "9a62a50b50b769a737bc0a8ff381f333529df3ab746b2f6b02e83760231455ba" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + http: + dependency: transitive + description: + name: http + sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412" + url: "https://pub.dev" + source: hosted + version: "1.6.0" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867" + url: "https://pub.dev" + source: hosted + version: "0.20.3" + jni: + dependency: transitive + description: + name: jni + sha256: f038e58b4dc2c9037f50e233175086337e0b305e356d28211bf55f21c504cbd3 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + jni_flutter: + dependency: transitive + description: + name: jni_flutter + sha256: b2310cdd4c18c65c081ab141a41efa94aa26c65431803703ece51996f174f351 + url: "https://pub.dev" + source: hosted + version: "1.0.3" + jni_util: + dependency: transitive + description: + name: jni_util + sha256: "1ba86da04a5f2bf18fde2edb235587e70c5b0fc5bd4ba955f46b00942c3fc35f" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "33e2e26bdd85a0112ec15400c8cbffea70d0f9c3407491f672a2fad47915e2de" + url: "https://pub.dev" + source: hosted + version: "11.0.2" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1" + url: "https://pub.dev" + source: hosted + version: "3.0.10" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + lints: + dependency: transitive + description: + name: lints + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + listen: + dependency: transitive + description: + name: listen + sha256: "47501a08016a43fcad79252439d723f50f14f88fa7bfd8a177e0a417e5c9e1f2" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + lucide_icons_flutter: + dependency: "direct main" + description: + name: lucide_icons_flutter + sha256: "50a21003cfe094e33b87e780d62ed5be84c32273dec1ba04547aab7df3cba00c" + url: "https://pub.dev" + source: hosted + version: "3.1.20" + matcher: + dependency: transitive + description: + name: matcher + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + url: "https://pub.dev" + source: hosted + version: "0.12.19" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" + url: "https://pub.dev" + source: hosted + version: "0.13.0" + meta: + dependency: transitive + description: + name: meta + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + url: "https://pub.dev" + source: hosted + version: "1.18.0" + objective_c: + dependency: transitive + description: + name: objective_c + sha256: b7fb95a6d9a4f009edd63dc5ac69f07420b23a16161c6dd8660290b59c602e8e + url: "https://pub.dev" + source: hosted + version: "9.5.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: ffcf4cf3d6c0b74ac43708d9f56625506e8a68aa935abe9d267a7330f320eb5d + url: "https://pub.dev" + source: hosted + version: "3.0.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 + url: "https://pub.dev" + source: hosted + version: "2.1.6" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "69cbd515a62b94d32a7944f086b2f82b4ac40a1d45bebfc00813a430ab2dabcd" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "2a376b7d6392d80cd3705782d2caa734ca4727776db0b6ec36ef3f1855197699" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" + url: "https://pub.dev" + source: hosted + version: "2.1.3" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 + url: "https://pub.dev" + source: hosted + version: "2.3.0" + platform: + dependency: transitive + description: + name: platform + sha256: a36d119c13416516a7b5913fbe8af8531e11633d784c550b2125f76c758524ec + url: "https://pub.dev" + source: hosted + version: "3.2.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "261236774e8b1d69cfc6b9eabbc96c40f25e7a2d6b171f3385d4f65d5734fb24" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + record_use: + dependency: transitive + description: + name: record_use + sha256: "2551bd8eecfe95d14ae75f6021ad0248be5c27f138c2ec12fcb52b500b3ba1ed" + url: "https://pub.dev" + source: hosted + version: "0.6.0" + riverpod: + dependency: transitive + description: + name: riverpod + sha256: "484dfc873ea4c4f4240e5635444fa066f87b07862b7279ebd004a2b71fba4b7a" + url: "https://pub.dev" + source: hosted + version: "3.4.3" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: c3025c5534b01739267eb7d76959bbc25a6d10f6988e1c2a3036940133dd10bf + url: "https://pub.dev" + source: hosted + version: "2.5.5" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: "1e12aafe408aa50da80edfd679a2a6bf63ba7ab37c7fa98286da459a757b3399" + url: "https://pub.dev" + source: hosted + version: "2.4.28" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: "2ec3934efa51e46117f23031cc141b8fc878e8525b94ec1ea4f7f586cf1b47ea" + url: "https://pub.dev" + source: hosted + version: "2.5.7" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "649dc798a33931919ea356c4305c2d1f81619ea6e92244070b520187b5140ef9" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 + url: "https://pub.dev" + source: hosted + version: "2.4.3" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "56a02f1f4cd1a2d96303c0144c93bd6d909eea6bee6bf5a0e0b685edbd4c47ab" + url: "https://pub.dev" + source: hosted + version: "1.10.2" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" + url: "https://pub.dev" + source: hosted + version: "1.12.1" + state_notifier: + dependency: transitive + description: + name: state_notifier + sha256: b8677376aa54f2d7c58280d5a007f9e8774f1968d1fb1c096adcb4792fba29bb + url: "https://pub.dev" + source: hosted + version: "1.0.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + test_api: + dependency: transitive + description: + name: test_api + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + url: "https://pub.dev" + source: hosted + version: "0.7.11" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + uuid: + dependency: transitive + description: + name: uuid + sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd" + url: "https://pub.dev" + source: hosted + version: "4.6.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + url: "https://pub.dev" + source: hosted + version: "2.2.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: "5f37239c4851efcef929cea7824e76df7f2f0970aef85d66bbc430afa40e72f0" + url: "https://pub.dev" + source: hosted + version: "15.3.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: f67cdd8e07d3c6329146aaef1ba043542b3134c12489f553ca9a7435d1068aea + url: "https://pub.dev" + source: hosted + version: "3.1.4" +sdks: + dart: ">=3.12.2 <4.0.0" + flutter: ">=3.44.0" diff --git a/pubspec.yaml b/pubspec.yaml new file mode 100644 index 0000000..532e17f --- /dev/null +++ b/pubspec.yaml @@ -0,0 +1,95 @@ +name: krow_worker_app +description: "A new Flutter project." +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: ^3.12.2 + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + go_router: ^17.5.0 + flutter_riverpod: ^3.4.3 + google_fonts: ^8.2.1 + lucide_icons_flutter: ^3.1.20 + intl: ^0.20.3 + shared_preferences: ^2.5.5 + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^6.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package diff --git a/test/screen_layout_test.dart b/test/screen_layout_test.dart new file mode 100644 index 0000000..19c4fa5 --- /dev/null +++ b/test/screen_layout_test.dart @@ -0,0 +1,100 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:krow_worker_app/core/theme.dart'; +import 'package:krow_worker_app/screens/clock_screen.dart'; +import 'package:krow_worker_app/screens/pay_screens.dart'; +import 'package:krow_worker_app/screens/profile_screen.dart'; +import 'package:krow_worker_app/screens/shifts_screen.dart'; +import 'package:krow_worker_app/screens/today_screen.dart'; +import 'package:krow_worker_app/state/session_controller.dart'; +import 'package:shared_preferences/shared_preferences.dart'; + +/// Overflow is reported as a thrown FlutterError, and the stripes only appear +/// in a debug build — so a release web check cannot see it and it reaches a +/// device first. These pump every tab at real phone sizes to catch it here. +void main() { + late SharedPreferences prefs; + + setUp(() async { + SharedPreferences.setMockInitialValues({}); + prefs = await SharedPreferences.getInstance(); + }); + + Future pumpScreen( + WidgetTester tester, + Widget screen, { + required Size size, + double textScale = 1.0, + }) async { + tester.view.physicalSize = size; + tester.view.devicePixelRatio = 1.0; + addTearDown(tester.view.reset); + + // Captured rather than left to the default handler, so a failure names the + // widget that overflowed instead of just the pixel count. + final errors = []; + final previousHandler = FlutterError.onError; + FlutterError.onError = errors.add; + + await tester.pumpWidget( + ProviderScope( + overrides: [prefsProvider.overrideWithValue(prefs)], + child: MaterialApp( + theme: buildKrowTheme(), + home: MediaQuery( + data: MediaQueryData( + size: size, + textScaler: TextScaler.linear(textScale), + // A notch, so the header has to make room for it. + padding: const EdgeInsets.only(top: 44, bottom: 34), + ), + child: screen, + ), + ), + ), + ); + await tester.pump(); + FlutterError.onError = previousHandler; + + if (errors.isNotEmpty) { + fail(errors.map((e) => e.toString()).join('\n\n')); + } + + // Screens with running timers must be torn down, or the test fails on a + // pending timer rather than on what it is checking. + await tester.pumpWidget(const SizedBox.shrink()); + } + + final screens = { + 'Today': const TodayScreen(), + 'Shifts': const ShiftsScreen(), + 'Clock': const ClockScreen(), + 'Pay': const PayScreen(), + 'Profile': const ProfileScreen(), + }; + + // A small phone, a tall one, and a short-but-wide one. + final sizes = { + 'small phone': const Size(360, 640), + 'tall phone': const Size(412, 915), + 'compact': const Size(320, 568), + }; + + for (final screen in screens.entries) { + for (final size in sizes.entries) { + testWidgets('${screen.key} lays out on a ${size.key}', (tester) async { + await pumpScreen(tester, screen.value, size: size.value); + }); + } + + testWidgets('${screen.key} survives large system text', (tester) async { + await pumpScreen( + tester, + screen.value, + size: const Size(360, 640), + textScale: 1.3, + ); + }); + } +} diff --git a/test/shift_logic_test.dart b/test/shift_logic_test.dart new file mode 100644 index 0000000..6206a6d --- /dev/null +++ b/test/shift_logic_test.dart @@ -0,0 +1,128 @@ +import 'package:flutter_test/flutter_test.dart'; +import 'package:krow_worker_app/core/formatters.dart'; +import 'package:krow_worker_app/models/shift.dart'; +import 'package:krow_worker_app/models/timecard.dart'; + +Shift buildShift({ + ShiftStatus status = ShiftStatus.booked, + DateTime? clockIn, + DateTime? clockOut, + int breakMinutes = 30, +}) { + final start = DateTime(2026, 8, 10, 17, 50); + return Shift( + id: 's1', + role: 'Barista', + business: 'Zoox', + venue: 'Zoox - San Jose Hub', + address: '848 E Gish Rd', + start: start, + end: start.add(const Duration(hours: 6)), + rate: 21.00, + status: status, + breakMinutes: breakMinutes, + clockIn: clockIn, + clockOut: clockOut, + ); +} + +void main() { + group('Shift pay', () { + test('scheduled pay deducts the unpaid break', () { + final shift = buildShift(); + expect(shift.scheduledDuration, const Duration(hours: 5, minutes: 30)); + expect(shift.scheduledPay, closeTo(115.50, 0.001)); + }); + + test('worked hours replace the schedule once clocked out', () { + final shift = buildShift( + status: ShiftStatus.completed, + clockIn: DateTime(2026, 8, 10, 18, 1), + clockOut: DateTime(2026, 8, 10, 23, 50), + ); + // 5h49m on the clock, less the 30 minute break. + expect(shift.workedDuration, const Duration(hours: 5, minutes: 19)); + expect(shift.pay, closeTo(111.65, 0.01)); + }); + + test('a clocked window shorter than the break never goes negative', () { + final shift = buildShift( + status: ShiftStatus.completed, + clockIn: DateTime(2026, 8, 10, 18, 0), + clockOut: DateTime(2026, 8, 10, 18, 5), + ); + expect(shift.workedDuration, Duration.zero); + expect(shift.pay, 0); + }); + + test('cancelled and no-show shifts generate no pay', () { + expect(buildShift(status: ShiftStatus.cancelled).pay, 0); + expect(buildShift(status: ShiftStatus.noShow).pay, 0); + }); + }); + + group('Timecard', () { + Timecard card({required DateTime clockIn}) { + final start = DateTime(2026, 8, 10, 17, 50); + return Timecard( + id: 'tc1', + shiftId: 's1', + role: 'Barista', + business: 'Zoox', + scheduledStart: start, + scheduledEnd: start.add(const Duration(hours: 6)), + clockIn: clockIn, + clockOut: DateTime(2026, 8, 10, 23, 50), + breakMinutes: 30, + rate: 21.00, + status: TimecardStatus.needsReview, + submittedAt: DateTime(2026, 8, 11, 0, 2), + ); + } + + test('variance is positive when you clock in late', () { + expect(card(clockIn: DateTime(2026, 8, 10, 18, 1)).varianceMinutes, 11); + }); + + test('variance is negative when you clock in early', () { + expect(card(clockIn: DateTime(2026, 8, 10, 17, 45)).varianceMinutes, -5); + }); + + test('amount follows the clocked hours', () { + expect( + card(clockIn: DateTime(2026, 8, 10, 18, 1)).amount, + closeTo(111.65, 0.01), + ); + }); + }); + + group('Formatters', () { + test('duration reads as hours and minutes', () { + expect(Fmt.duration(const Duration(hours: 5, minutes: 19)), '5h 19m'); + expect(Fmt.duration(const Duration(minutes: 45)), '45m'); + }); + + test('stopwatch pads every field', () { + expect( + Fmt.stopwatch(const Duration(hours: 1, minutes: 2, seconds: 3)), + '01:02:03', + ); + }); + + test('countdown switches unit as the shift approaches', () { + final now = DateTime(2026, 8, 10, 12, 0); + expect( + Fmt.untilStart(now.add(const Duration(minutes: 41)), now: now), + 'In 41 min', + ); + expect( + Fmt.untilStart(now.add(const Duration(hours: 3)), now: now), + 'In 3 hr', + ); + expect( + Fmt.untilStart(now.subtract(const Duration(minutes: 5)), now: now), + 'Started', + ); + }); + }); +} diff --git a/test/transitions_test.dart b/test/transitions_test.dart new file mode 100644 index 0000000..7e0e225 --- /dev/null +++ b/test/transitions_test.dart @@ -0,0 +1,88 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:go_router/go_router.dart'; +import 'package:krow_worker_app/core/transitions.dart'; + +const _detail = Key('detail'); + +GoRouter buildRouter() => GoRouter( + routes: [ + GoRoute( + path: '/', + builder: (_, _) => const Scaffold(body: Text('home')), + ), + GoRoute( + path: '/detail', + pageBuilder: (_, state) => Transitions.push( + state, + const Scaffold(body: SizedBox.expand(key: _detail)), + ), + ), + GoRoute( + path: '/replaced', + pageBuilder: (_, state) => Transitions.fade( + state, + const Scaffold(body: SizedBox.expand(key: _detail)), + ), + ), + ], +); + +void main() { + group('Transitions.push', () { + testWidgets('settles flush against the left edge', (tester) async { + final router = buildRouter(); + addTearDown(router.dispose); + await tester.pumpWidget(MaterialApp.router(routerConfig: router)); + + router.push('/detail'); + await tester.pumpAndSettle(); + + // The page is driven by two animations at once, and its resting state + // comes from the one that is *not* running. Reversing that tween leaves + // the screen parked off to the side, which is easy to miss in code and + // obvious on a phone. + final rect = tester.getRect(find.byKey(_detail)); + expect(rect.left, 0); + expect( + rect.width, + tester.view.physicalSize.width / tester.view.devicePixelRatio, + ); + }); + + testWidgets('enters from the right rather than appearing', (tester) async { + final router = buildRouter(); + addTearDown(router.dispose); + await tester.pumpWidget(MaterialApp.router(routerConfig: router)); + + router.push('/detail'); + await tester.pump(); + await tester.pump(const Duration(milliseconds: 80)); + + expect(tester.getRect(find.byKey(_detail)).left, greaterThan(0)); + }); + }); + + group('Transitions.fade', () { + testWidgets('settles flush and fully opaque', (tester) async { + final router = buildRouter(); + addTearDown(router.dispose); + await tester.pumpWidget(MaterialApp.router(routerConfig: router)); + + router.push('/replaced'); + await tester.pumpAndSettle(); + + expect(tester.getRect(find.byKey(_detail)).left, 0); + + final fade = tester.widget( + find + .ancestor( + of: find.byKey(_detail), + matching: find.byType(FadeTransition), + ) + .first, + ); + expect(fade.opacity.value, 1); + }); + }); +} diff --git a/test/widgets_test.dart b/test/widgets_test.dart new file mode 100644 index 0000000..1cfe3e7 --- /dev/null +++ b/test/widgets_test.dart @@ -0,0 +1,195 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:krow_worker_app/core/theme.dart'; +import 'package:krow_worker_app/widgets/common.dart'; +import 'package:krow_worker_app/widgets/glass_segments.dart'; +import 'package:krow_worker_app/widgets/krow_nav_bar.dart'; + +Widget wrap(Widget child) => MaterialApp( + theme: buildKrowTheme(), + home: Scaffold(body: child), +); + +void main() { + group('KrowNavBar', () { + const items = [ + KrowNavItem(icon: Icons.home, label: 'Today'), + KrowNavItem(icon: Icons.work, label: 'Shifts'), + KrowNavItem(icon: Icons.timer, label: 'Clock', showDot: true), + ]; + + testWidgets('renders every label', (tester) async { + await tester.pumpWidget( + wrap(KrowNavBar(items: items, currentIndex: 0, onSelect: (_) {})), + ); + + expect(find.text('Today'), findsOneWidget); + expect(find.text('Shifts'), findsOneWidget); + expect(find.text('Clock'), findsOneWidget); + }); + + testWidgets('reports the tapped index', (tester) async { + var selected = -1; + await tester.pumpWidget( + wrap( + KrowNavBar( + items: items, + currentIndex: 0, + onSelect: (i) => selected = i, + ), + ), + ); + + await tester.tap(find.text('Clock')); + expect(selected, 2); + }); + + testWidgets('announces a tab that needs attention', (tester) async { + await tester.pumpWidget( + wrap(KrowNavBar(items: items, currentIndex: 0, onSelect: (_) {})), + ); + + // The dot is not readable, so the state has to reach the semantics tree. + expect(find.bySemanticsLabel('Clock, needs attention'), findsOneWidget); + expect(find.bySemanticsLabel('Today'), findsOneWidget); + }); + + testWidgets('the indicator travels rather than jumping', (tester) async { + var index = 0; + await tester.pumpWidget( + wrap( + StatefulBuilder( + builder: (context, setState) => KrowNavBar( + items: items, + currentIndex: index, + onSelect: (i) => setState(() => index = i), + ), + ), + ), + ); + + Rect pillRect() => tester.getRect(find.byKey(KrowNavBar.indicatorKey)); + + final start = pillRect().center.dx; + await tester.tap(find.text('Clock')); + await tester.pump(); + await tester.pump(const Duration(milliseconds: 120)); + + // Part way through it should be between the two tabs, not already there. + final middle = pillRect().center.dx; + expect(middle, greaterThan(start)); + + await tester.pumpAndSettle(); + final end = pillRect().center.dx; + expect(end, greaterThan(middle)); + }); + }); + + group('StatSlabRow', () { + // Every real use sits in a scrolling column, where the height is + // unbounded. Testing it against a bounded Scaffold body hides exactly the + // layout errors this row is prone to. + Widget inScrollable(Widget child) => + wrap(ListView(children: [const SizedBox(height: 8), child])); + + testWidgets('lays out inside a scrollable', (tester) async { + await tester.pumpWidget( + inScrollable( + const StatSlabRow( + slabs: [ + StatSlab('Clock in', '6:01 PM'), + StatSlab('Clock out', '11:50 PM'), + StatSlab('Hours', '5h 19m'), + ], + ), + ), + ); + + expect(tester.takeException(), isNull); + // A row that tried to fill unbounded height would be enormous. + expect(tester.getSize(find.byType(StatSlabRow)).height, lessThan(120)); + }); + + testWidgets('keeps every card the same height, however long the text', ( + tester, + ) async { + await tester.pumpWidget( + inScrollable( + const StatSlabRow( + slabs: [ + // The middle one is what used to wrap on both lines and push + // its card taller than the two beside it. + StatSlab('Clock in', '6:01 PM'), + StatSlab('Clock out', '11:50 PM'), + StatSlab('Hours', '5h 19m'), + ], + ), + ), + ); + + final heights = tester + .widgetList(find.byType(StatSlab)) + .map((slab) => tester.getSize(find.byWidget(slab)).height) + .toSet(); + + expect(heights.length, 1, reason: 'cards should be one height'); + }); + + testWidgets('scales long values down instead of wrapping', (tester) async { + await tester.pumpWidget( + inScrollable( + const StatSlabRow( + slabs: [ + StatSlab('Paid', r'$1,234.56'), + StatSlab('Rate', r'$21.00/hr'), + StatSlab('Hours', '5h 19m'), + ], + ), + ), + ); + + for (final text in tester.widgetList(find.byType(Text))) { + expect(text.maxLines, 1); + } + }); + }); + + group('GlassSegments', () { + testWidgets('reports the tapped segment', (tester) async { + String? picked; + await tester.pumpWidget( + wrap( + GlassSegments( + segments: const [('a', 'Week'), ('b', 'Month'), ('c', 'Year')], + value: 'a', + onChanged: (v) => picked = v, + ), + ), + ); + + await tester.tap(find.text('Year')); + expect(picked, 'c'); + }); + + testWidgets('ignores a tap on the segment already selected', ( + tester, + ) async { + var calls = 0; + await tester.pumpWidget( + wrap( + GlassSegments( + segments: const [('a', 'Week'), ('b', 'Month')], + value: 'a', + onChanged: (_) => calls++, + ), + ), + ); + + await tester.tap(find.text('Week')); + expect(calls, 0); + + await tester.tap(find.text('Month')); + expect(calls, 1); + }); + }); +} diff --git a/web/favicon.png b/web/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..8aaa46ac1ae21512746f852a42ba87e4165dfdd1 GIT binary patch literal 917 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|I14-?iy0X7 zltGxWVyS%@P(fs7NJL45ua8x7ey(0(N`6wRUPW#JP&EUCO@$SZnVVXYs8ErclUHn2 zVXFjIVFhG^g!Ppaz)DK8ZIvQ?0~DO|i&7O#^-S~(l1AfjnEK zjFOT9D}DX)@^Za$W4-*MbbUihOG|wNBYh(yU7!lx;>x^|#0uTKVr7USFmqf|i<65o z3raHc^AtelCMM;Vme?vOfh>Xph&xL%(-1c06+^uR^q@XSM&D4+Kp$>4P^%3{)XKjo zGZknv$b36P8?Z_gF{nK@`XI}Z90TzwSQO}0J1!f2c(B=V`5aP@1P1a|PZ!4!3&Gl8 zTYqUsf!gYFyJnXpu0!n&N*SYAX-%d(5gVjrHJWqXQshj@!Zm{!01WsQrH~9=kTxW#6SvuapgMqt>$=j#%eyGrQzr zP{L-3gsMA^$I1&gsBAEL+vxi1*Igl=8#8`5?A-T5=z-sk46WA1IUT)AIZHx1rdUrf zVJrJn<74DDw`j)Ki#gt}mIT-Q`XRa2-jQXQoI%w`nb|XblvzK${ZzlV)m-XcwC(od z71_OEC5Bt9GEXosOXaPTYOia#R4ID2TiU~`zVMl08TV_C%DnU4^+HE>9(CE4D6?Fz oujB08i7adh9xk7*FX66dWH6F5TM;?E2b5PlUHx3vIVCg!0Dx9vYXATM literal 0 HcmV?d00001 diff --git a/web/icons/Icon-192.png b/web/icons/Icon-192.png new file mode 100644 index 0000000000000000000000000000000000000000..b749bfef07473333cf1dd31e9eed89862a5d52aa GIT binary patch literal 5292 zcmZ`-2T+sGz6~)*FVZ`aW+(v>MIm&M-g^@e2u-B-DoB?qO+b1Tq<5uCCv>ESfRum& zp%X;f!~1{tzL__3=gjVJ=j=J>+nMj%ncXj1Q(b|Ckbw{Y0FWpt%4y%$uD=Z*c-x~o zE;IoE;xa#7Ll5nj-e4CuXB&G*IM~D21rCP$*xLXAK8rIMCSHuSu%bL&S3)8YI~vyp@KBu9Ph7R_pvKQ@xv>NQ`dZp(u{Z8K3yOB zn7-AR+d2JkW)KiGx0hosml;+eCXp6+w%@STjFY*CJ?udJ64&{BCbuebcuH;}(($@@ znNlgBA@ZXB)mcl9nbX#F!f_5Z=W>0kh|UVWnf!At4V*LQP%*gPdCXd6P@J4Td;!Ur z<2ZLmwr(NG`u#gDEMP19UcSzRTL@HsK+PnIXbVBT@oHm53DZr?~V(0{rsalAfwgo zEh=GviaqkF;}F_5-yA!1u3!gxaR&Mj)hLuj5Q-N-@Lra{%<4ONja8pycD90&>yMB` zchhd>0CsH`^|&TstH-8+R`CfoWqmTTF_0?zDOY`E`b)cVi!$4xA@oO;SyOjJyP^_j zx^@Gdf+w|FW@DMdOi8=4+LJl$#@R&&=UM`)G!y%6ZzQLoSL%*KE8IO0~&5XYR9 z&N)?goEiWA(YoRfT{06&D6Yuu@Qt&XVbuW@COb;>SP9~aRc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oCM1n!A&-8`;#RDcZyk*+RPkn_r8?Ak@agHiSp*qFNX)&i21HE?yuZ;-C<3C zwJGd1lx5UzViP7sZJ&|LqH*mryb}y|%AOw+v)yc`qM)03qyyrqhX?ub`Cjwx2PrR! z)_z>5*!*$x1=Qa-0uE7jy0z`>|Ni#X+uV|%_81F7)b+nf%iz=`fF4g5UfHS_?PHbr zB;0$bK@=di?f`dS(j{l3-tSCfp~zUuva+=EWxJcRfp(<$@vd(GigM&~vaYZ0c#BTs z3ijkxMl=vw5AS&DcXQ%eeKt!uKvh2l3W?&3=dBHU=Gz?O!40S&&~ei2vg**c$o;i89~6DVns zG>9a*`k5)NI9|?W!@9>rzJ;9EJ=YlJTx1r1BA?H`LWijk(rTax9(OAu;q4_wTj-yj z1%W4GW&K4T=uEGb+E!>W0SD_C0RR91 literal 0 HcmV?d00001 diff --git a/web/icons/Icon-512.png b/web/icons/Icon-512.png new file mode 100644 index 0000000000000000000000000000000000000000..88cfd48dff1169879ba46840804b412fe02fefd6 GIT binary patch literal 8252 zcmd5=2T+s!lYZ%-(h(2@5fr2dC?F^$C=i-}R6$UX8af(!je;W5yC_|HmujSgN*6?W z3knF*TL1$|?oD*=zPbBVex*RUIKsL<(&Rj9%^UD2IK3W?2j>D?eWQgvS-HLymHo9%~|N2Q{~j za?*X-{b9JRowv_*Mh|;*-kPFn>PI;r<#kFaxFqbn?aq|PduQg=2Q;~Qc}#z)_T%x9 zE|0!a70`58wjREmAH38H1)#gof)U3g9FZ^ zF7&-0^Hy{4XHWLoC*hOG(dg~2g6&?-wqcpf{ z&3=o8vw7lMi22jCG9RQbv8H}`+}9^zSk`nlR8?Z&G2dlDy$4#+WOlg;VHqzuE=fM@ z?OI6HEJH4&tA?FVG}9>jAnq_^tlw8NbjNhfqk2rQr?h(F&WiKy03Sn=-;ZJRh~JrD zbt)zLbnabttEZ>zUiu`N*u4sfQaLE8-WDn@tHp50uD(^r-}UsUUu)`!Rl1PozAc!a z?uj|2QDQ%oV-jxUJ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Er%xUHMVqfB;(f?OPtMnAZ#rm5q5mh;a2f_si2_ z3oXWB?{NF(JtkAn6F(O{z@b76OIqMC$&oJ_&S|YbFJ*)3qVX_uNf5b8(!vGX19hsG z(OP>RmZp29KH9Ge2kKjKigUmOe^K_!UXP`von)PR8Qz$%=EmOB9xS(ZxE_tnyzo}7 z=6~$~9k0M~v}`w={AeqF?_)9q{m8K#6M{a&(;u;O41j)I$^T?lx5(zlebpY@NT&#N zR+1bB)-1-xj}R8uwqwf=iP1GbxBjneCC%UrSdSxK1vM^i9;bUkS#iRZw2H>rS<2<$ zNT3|sDH>{tXb=zq7XZi*K?#Zsa1h1{h5!Tq_YbKFm_*=A5-<~j63he;4`77!|LBlo zR^~tR3yxcU=gDFbshyF6>o0bdp$qmHS7D}m3;^QZq9kBBU|9$N-~oU?G5;jyFR7>z hN`IR97YZXIo@y!QgFWddJ3|0`sjFx!m))><{BI=FK%f8s literal 0 HcmV?d00001 diff --git a/web/icons/Icon-maskable-192.png b/web/icons/Icon-maskable-192.png new file mode 100644 index 0000000000000000000000000000000000000000..eb9b4d76e525556d5d89141648c724331630325d GIT binary patch literal 5594 zcmdT|`#%%j|KDb2V@0DPm$^(Lx5}lO%Yv(=e*7hl@QqKS50#~#^IQPxBmuh|i9sXnt4ch@VT0F7% zMtrs@KWIOo+QV@lSs66A>2pz6-`9Jk=0vv&u?)^F@HZ)-6HT=B7LF;rdj zskUyBfbojcX#CS>WrIWo9D=DIwcXM8=I5D{SGf$~=gh-$LwY?*)cD%38%sCc?5OsX z-XfkyL-1`VavZ?>(pI-xp-kYq=1hsnyP^TLb%0vKRSo^~r{x?ISLY1i7KjSp z*0h&jG(Rkkq2+G_6eS>n&6>&Xk+ngOMcYrk<8KrukQHzfx675^^s$~<@d$9X{VBbg z2Fd4Z%g`!-P}d#`?B4#S-9x*eNlOVRnDrn#jY@~$jfQ-~3Od;A;x-BI1BEDdvr`pI z#D)d)!2_`GiZOUu1crb!hqH=ezs0qk<_xDm_Kkw?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UN4tGMLCzDzPqY$~`l<47{+l<{FZ$L6(>J)|}!bi<)| zE35dl{a2)&leQ@LlDxLQOfUDS`;+ZQ4ozrleQwaR-K|@9T{#hB5Z^t#8 zC-d_G;B4;F#8A2EBL58s$zF-=SCr`P#z zNCTnHF&|X@q>SkAoYu>&s9v@zCpv9lLSH-UZzfhJh`EZA{X#%nqw@@aW^vPcfQrlPs(qQxmC|4tp^&sHy!H!2FH5eC{M@g;ElWNzlb-+ zxpfc0m4<}L){4|RZ>KReag2j%Ot_UKkgpJN!7Y_y3;Ssz{9 z!K3isRtaFtQII5^6}cm9RZd5nTp9psk&u1C(BY`(_tolBwzV_@0F*m%3G%Y?2utyS zY`xM0iDRT)yTyYukFeGQ&W@ReM+ADG1xu@ruq&^GK35`+2r}b^V!m1(VgH|QhIPDE X>c!)3PgKfL&lX^$Z>Cpu&6)6jvi^Z! literal 0 HcmV?d00001 diff --git a/web/icons/Icon-maskable-512.png b/web/icons/Icon-maskable-512.png new file mode 100644 index 0000000000000000000000000000000000000000..d69c56691fbdb0b7efa65097c7cc1edac12a6d3e GIT binary patch literal 20998 zcmeFZ_gj-)&^4Nb2tlbLMU<{!p(#yjqEe+=0IA_oih%ScH9@5#MNp&}Y#;;(h=A0@ zh7{>lT2MkSQ344eAvrhici!td|HJuyvJm#Y_w1Q9Yu3!26dNlO-oxUDK_C#XnW^Co z5C{VN6#{~B0)K2j7}*1Xq(Nqemv23A-6&=ZpEijkVnSwVGqLv40?n0=p;k3-U5e5+ z+z3>aS`u9DS=!wg8ROu?X4TFoW6CFLL&{GzoVT)ldhLekLM|+j3tIxRd|*5=c{=s&*vfPdBr(Fyj(v@%eQj1Soy7m4^@VRl1~@-PV7y+c!xz$8436WBn$t{=}mEdK#k`aystimGgI{(IBx$!pAwFoE9Y`^t^;> zKAD)C(Dl^s%`?q5$P|fZf8Xymrtu^Pv(7D`rn>Z-w$Ahs!z9!94WNVxrJuXfHAaxg zC6s@|Z1$7R$(!#t%Jb{{s6(Y?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azCv;|?(W-q}$o&Y}Q5d@BRk^jL7#{kbCK zSgkyu;=DV+or2)AxCBgq-nj5=@n^`%T#V+xBGEkW4lCqrE)LMv#f;AvD__cQ@Eg3`~x| zW+h9mofSXCq5|M)9|ez(#X?-sxB%Go8};sJ?2abp(Y!lyi>k)|{M*Z$c{e1-K4ky` MPgg&ebxsLQ025IeI{*Lx literal 0 HcmV?d00001 diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..ebc38e4 --- /dev/null +++ b/web/index.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + krow_worker_app + + + + + + + diff --git a/web/manifest.json b/web/manifest.json new file mode 100644 index 0000000..11de6c7 --- /dev/null +++ b/web/manifest.json @@ -0,0 +1,35 @@ +{ + "name": "krow_worker_app", + "short_name": "krow_worker_app", + "start_url": ".", + "display": "standalone", + "background_color": "#0175C2", + "theme_color": "#0175C2", + "description": "A new Flutter project.", + "orientation": "portrait-primary", + "prefer_related_applications": false, + "icons": [ + { + "src": "icons/Icon-192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "icons/Icon-512.png", + "sizes": "512x512", + "type": "image/png" + }, + { + "src": "icons/Icon-maskable-192.png", + "sizes": "192x192", + "type": "image/png", + "purpose": "maskable" + }, + { + "src": "icons/Icon-maskable-512.png", + "sizes": "512x512", + "type": "image/png", + "purpose": "maskable" + } + ] +}