Screens & Navigation
MaxTracks Web uses a BottomNavigationBar with 15+ screens accessible from the main navigation. The app entry point is main.dart which initializes Firebase and sets up the BottomNav widget containing all screen routes.
Navigation Structure
The bottom nav bar shows icons for each major screen. Users tap to switch between screens. Some screens (like Invoice) require permission checks before access is granted.
1. Home / Track Package
File: main.dart (embedded in BottomNav)
The landing screen. Provides a search interface for tracking packages by tracking number. Users can look up any package and see its current status, scan history, and location in the pipeline.
2. Receiving
File: lib/features/receiving/pages/Receiving.dart
Displays all packages with status = received and isMissing = false. This is the first stage after a package enters the system from the scanner app.
Key behavior:
- Queries Firestore
Packagescollection filtered by status - Shows package details including tracking number, client, and logistic provider
- Allows drill-down into individual package details
3. Check In
File: lib/CheckIn.dart
Processes packages from “received” to “checked in” status. This is where packages are verified, measured, and assigned to containers for shipping.
Key behavior:
- Handles package check-in workflow
- Triggers
onPackageCheckIncloud function which creates/updates invoices - Manages container loading – assigns packages to containers
- Captures dimensions (height, length, width) for shipping calculations
4. In Transit
File: lib/InTransit.dart
Tracks all packages currently in transit to their destination. Shows container information and expected delivery timelines.
Key behavior:
- Displays packages grouped by container
- Shows transit status and container details
- Tracks packages from departure to arrival
5. Container Unloading
File: lib/ContainerUnloading.dart
Manages the process of unloading packages from containers upon arrival at the destination.
Key behavior:
- Lists containers ready for unloading
- Tracks which packages have been unloaded vs. remaining
- Updates package status from “inTransit” to “unloaded”
- Triggers notifications for unloaded packages
6. Client Pickup
File: lib/ClientPickUp.dart and lib/ClientPickUpFiltered.dart
Manages the final mile – clients coming to pick up their packages.
Key behavior:
- Shows packages ready for client pickup (status = unloaded)
- Filtered view (
ClientPickUpFiltered.dart) allows searching by client - Updates package status to complete upon pickup
- Displays client contact information
7. Unprocessed
File: lib/Unprocessed.dart
Handles packages that have not yet been fully processed through the system. Contains two tabs:
Tabs:
- Received – Packages received but not yet checked in
- In Transit – Packages in transit but missing processing steps
Key behavior:
- Identifies packages stuck in the pipeline
- Allows bulk actions to move packages forward
- Flags packages needing attention
8. Unloaded Not Checked In
File: lib/UnloadedNotCheckedIn.dart
Tracks packages that were unloaded from containers but never went through the check-in process – a data integrity monitor.
Key behavior:
- Queries for packages with status anomalies
- Triggers weekly email alerts via
weeklyUnloadedNotCheckedInEmailcloud function - Helps identify process gaps
9. Package Problems
File: lib/PackageProblems.dart
Flags and manages problematic packages that need manual intervention.
Problem Categories:
- Unknown Name – Package has an unrecognized client name
- No Name – Package has no client name at all
- No Address – Missing delivery address
- Damaged – Package arrived damaged
- Other – Miscellaneous issues
Key behavior:
- Categorizes problems for targeted resolution
- Allows staff to assign problems and track resolution
- Links back to package details for correction
10. Items & Discounts
File: lib/ItemsAndDiscounts.dart
Manages the product catalog, discount codes, and additional charges used in invoice generation.
Tabs:
- Items – Product catalog with costs, categories, and tax status
- Discounts – Discount codes with percentage or flat amounts
- Charges – Additional fees (handling, storage, customs, etc.)
Key behavior:
- CRUD operations on items, discounts, and charges
- Items linked to categories from
Categoriescollection - Discounts can be applied to specific clients
- Charges appear as line items on invoices
11. Invoice
File: lib/Invoice.dart
The invoice management hub. Password-protected – requires the view_approve_or_send_invoices permission.
Tabs:
- Unapproved – Invoices awaiting review
- Approved – Invoices ready to send
- All – Complete invoice list
Key behavior:
- Invoices are auto-generated when packages are checked in (via cloud function)
- Staff review and approve invoices manually
- Approved invoices can be sent to Square for payment processing
- Tracks Square payment status (sent, paid, overdue)
- Email notifications sent to clients
- Invoice contains: client info, packages list, item costs, discounts, charges, total
12. Permissions
File: lib/Permissions.dart
Manages user access control. Requires edit_permissions permission to access.
Key behavior:
- Lists all permission actions from
webPermissionscollection - Shows which users have access to each action
- Add/remove users from permission groups
- Actions include:
view_approve_or_send_invoices,edit_permissions,view_qr
13. Logs
File: lib/Logs.dart
Activity and action logging dashboard. Shows a chronological feed of all actions performed in the system.
Key behavior:
- Reads from
webLogsFirestore collection - Displays: action type, message, timestamp
- Useful for auditing and debugging
- Logs written by both web app and cloud functions
14. Loaded Packages
File: lib/LoadedPackages.dart
File management interface for loaded package documents stored in Firebase Storage.
Key behavior:
- Reads files from Firebase Storage
loadedPackages/folder - Displays uploaded documents (manifests, packing lists)
- Allows viewing and downloading files
15. Prepaid
File: lib/Prepaid.dart
Manages prepaid shipping documents and files.
Key behavior:
- Reads from Firebase Storage
prepaid/folder - Tracks prepaid shipment documentation
- Triggers
prepaidSendEmailcloud function for notifications
Package Status Flow
Each package progresses through these statuses:
scanned --> received --> checkIn --> inTransit --> unloaded --> pickup --> complete
A package can also be CONSOLIDATED (merged into another package) at any point after receiving.
Each status transition is tracked in the package’s scanHistory array with timestamps and user roles.