Overview
Trackmart uses a variety of Flutter packages to implement features like authentication, real-time database, mapping, messaging, and more. This page documents all dependencies, their versions, and their purposes.Environment
The application requires Dart SDK version 2.2.0 or higher, but below 3.0.0. Consider updating to support Dart 3.0+ for better performance and features.
Core Dependencies
Flutter SDK
flutter
flutter
Version: SDKPurpose: Core Flutter frameworkThe fundamental Flutter SDK that provides widgets, rendering, and platform integration.
Firebase & Backend Services
Trackmart relies heavily on Firebase for backend services including authentication, database, storage, and messaging.firebase_auth
Version: ^0.11.1+7Purpose: User authenticationHandles phone number authentication, email/password login, and user session management.Key Features:
- Phone OTP verification
- Email verification
- User state persistence
- Sign in/out functionality
cloud_firestore
Version: 0.12.7+1Purpose: NoSQL cloud databaseReal-time database for user profiles, driver information, and chat messages.Collections:
users: User profilesdrivers: Driver profilesmessages: Chat data
firebase_database
Version: 3.0.5Purpose: Real-time databaseHandles real-time order requests, location updates, and driver-buyer interactions.Features:
- Real-time synchronization
- Offline persistence
- Hierarchical data structure
firebase_storage
Version: 3.0.4Purpose: File storageStores user profile photos, chat images, and other media files.Usage:
- Profile picture uploads
- Chat image sharing
- Media caching
firebase_messaging
firebase_messaging
Version: 5.1.2Purpose: Push notificationsSends real-time notifications for order updates, messages, and delivery status.Features:
- FCM token management
- Background message handling
- Notification payload processing
- Device-to-device messaging
lib/root_page.dart:21-46Location & Mapping
geolocator
geolocator
Version: 5.1.1+1Purpose: GPS location servicesProvides real-time location tracking for users and drivers.Features:Usage in app: Tracks user location for delivery coordination (see
- Current position retrieval
- Continuous location updates
- Location accuracy settings
- Distance calculations
lib/home_page.dart:193-203)flutter_map
flutter_map
Version: 0.7.0+2Purpose: Interactive map widgetDisplays maps with markers, routes, and interactive features.Features:
- Customizable map layers
- Marker placement
- Polyline drawing
- Zoom and pan controls
lib/map.dart for driver location and route visualizationflutter_polyline_points
flutter_polyline_points
Version: 0.1.0Purpose: Route drawingDecodes polyline strings and draws routes on maps between user and driver locations.Usage:
- Delivery route visualization
- Distance calculation
- ETA estimation
permission_handler
permission_handler
Version: ^3.1.0Purpose: Runtime permissionsManages location, camera, and storage permissions required by the app.Permissions Handled:
- Location (always/when in use)
- Camera (for profile photos)
- Storage (for image caching)
- Notifications
Networking & HTTP
dio
dio
Version: 2.1.13Purpose: HTTP clientPowerful HTTP client for API requests, including currency conversion and external data fetching.Features:
- Request/response interceptors
- FormData support
- Timeout configuration
- Error handling
lib/home_page.dart:75)Local Storage
sqflite
Version: Latest (no version specified)Purpose: SQLite databaseLocal database for offline data persistence and caching.Stored Data:
- Order history
- Cached driver info
- Offline messages
shared_preferences
Version: 0.5.3+4Purpose: Key-value storageStores simple data like user preferences and settings.Stored Data:
- User display name
- Phone number
- Photo URL
- App settings
path
path
Version: Latest (no version specified)Purpose: File path manipulationProvides utilities for working with file and directory paths, especially for SQLite database location.Common Usage:
UI & User Experience
cached_network_image
cached_network_image
Version: 1.1.1Purpose: Image cachingEfficiently loads and caches network images with placeholder support.Features:
- Automatic disk and memory caching
- Placeholder widgets during loading
- Error handling
- Progressive loading
lib/home_page.dart:344-358)image_picker
image_picker
Version: 0.6.0+17Purpose: Camera and gallery accessAllows users to select images from gallery or take photos with camera.Features:
- Camera capture
- Gallery selection
- Image compression
- iOS and Android support
smooth_star_rating
smooth_star_rating
Version: 1.0.3Purpose: Star rating widgetCustomizable star rating widget for rating drivers and deliveries.Features:
- Half-star support
- Custom star icons
- Touch interaction
- Read-only mode
fluttertoast
fluttertoast
Version: 3.1.0Purpose: Toast notificationsShows brief, non-intrusive messages to users.Features:
- Customizable duration
- Position control
- Background and text colors
- Gravity settings
Notifications
flutter_local_notifications
flutter_local_notifications
Version: 0.8.0Purpose: Local notificationsDisplays notifications on the device for incoming messages and order updates.Features:
- Android notifications
- iOS notifications
- Custom notification sounds
- Notification actions
- Scheduled notifications
lib/root_page.dart:80-96 for notification configurationInput & Forms
flutter_masked_text
Version: ^0.8.0Purpose: Masked text inputFormats text input with masks (e.g., phone numbers, credit cards).Usage:
- Phone number formatting
- Card number input
- Custom input patterns
country_code_picker
Version: 1.1.7Purpose: Country code selectionDropdown widget for selecting country codes during phone authentication.Features:
- Country flags
- Search functionality
- Dial codes
- Country names
Utilities
intl
intl
Version: 0.15.8Purpose: InternationalizationProvides date formatting, number formatting, and localization support.Features:
- Date/time formatting
- Number formatting
- Currency formatting
- Message translation
url_launcher
url_launcher
Version: ^4.0.3Purpose: Launch URLsOpens external URLs, phone calls, emails, and other URI schemes.Capabilities:
- Web URLs (browser)
- Tel: links (phone dialer)
- Mailto: links (email client)
- SMS and other schemes
lib/contact.dart)share
share
Dev Dependencies
Development and testing dependencies:- Testing
- Build Tools
flutter_test
flutter_test
Version: SDKPurpose: Flutter testing frameworkProvides testing utilities for unit and widget tests.
flutter_driver
flutter_driver
Version: SDKPurpose: Integration testingDrives the app from a separate process for end-to-end testing.
test
test
Version: anyPurpose: Core testing libraryDart’s testing framework for unit tests.
flutter_gherkin
flutter_gherkin
Version: ^0.0.12Purpose: BDD testingBehavior-driven development testing with Gherkin syntax.Features:
- Given-When-Then syntax
- Readable test scenarios
- Step definitions
Dependency Management
Installing Dependencies
To install all dependencies listed inpubspec.yaml:
Updating Dependencies
To update dependencies to the latest compatible versions:Checking for Outdated Packages
To see which packages have newer versions available:Recommended Upgrades
Consider upgrading these packages for better performance, security, and features:
| Package | Current | Latest | Notes |
|---|---|---|---|
| firebase_auth | 0.11.1+7 | 4.x.x | Breaking changes |
| cloud_firestore | 0.12.7+1 | 4.x.x | Breaking changes |
| geolocator | 5.1.1+1 | 10.x.x | Breaking changes |
| flutter_map | 0.7.0+2 | 6.x.x | Major updates |
| cached_network_image | 1.1.1 | 3.x.x | Performance improvements |
| dio | 2.1.13 | 5.x.x | Null safety |
Migration to Null Safety
Common Issues & Solutions
Pod install fails on iOS
Pod install fails on iOS
Problem: CocoaPods dependencies fail to installSolution:
Gradle build fails on Android
Gradle build fails on Android
Problem: Android build fails with dependency conflictsSolution:
- Update
android/build.gradlewith compatible versions - Clean build:
- Rebuild:
Version conflict errors
Version conflict errors
Problem: Multiple packages require different versions of the same dependencySolution:
- Use
dependency_overridesinpubspec.yaml(temporary fix) - Update conflicting packages to compatible versions
- Check package compatibility at pub.dev
Additional Resources
pub.dev
Official Dart package repository
Flutter Packages
Flutter package documentation
Firebase Flutter
Firebase for Flutter setup guide
Package Management
Dart package management guide
Next Steps
Installation
Set up your development environment
Project Structure
Understand the codebase organization