Prerequisites
Before you begin, ensure you have:- Flutter SDK 3.7.2 or higher installed
- Dart SDK (comes with Flutter)
- Android Studio or Xcode (for mobile development)
- Git installed
- A code editor (VS Code, Android Studio, or IntelliJ recommended)
If you don’t have Flutter installed, follow the official Flutter installation guide for your operating system.
Step 1: Verify Flutter Installation
First, verify that Flutter is properly installed:Step 2: Clone the Repository
Clone the App Courier repository to your local machine:Replace
<repository-url> with the actual repository URL provided by your team.Step 3: Install Dependencies
Install all required Flutter packages:pubspec.yaml, including:
diofor HTTP requestsproviderfor state managementshared_preferencesfor local storageimage_picker,fl_chart,pdf, and more
Step 4: Configure API Endpoint (Optional)
The app is pre-configured to connect to the production API. If you need to use a different API endpoint:Step 5: Set Up Device/Emulator
You need either a physical device or an emulator to run the app.- Android
- iOS
Using Android Emulator
- Open Android Studio
- Go to Tools > Device Manager
- Create a new virtual device (or start an existing one)
- Verify the emulator is running:
Using Physical Android Device
- Enable Developer Options on your Android device
- Enable USB Debugging
- Connect your device via USB
- Verify the device is detected:
Step 6: Run the Application
Now you’re ready to launch the app!- Build the application
- Install it on your connected device/emulator
- Launch the app
- Enable hot reload for development
The first build may take several minutes. Subsequent builds will be much faster thanks to Flutter’s caching.
Run Specific Platform
To run on a specific device when multiple devices are connected:Step 7: Test the Application
Once the app launches, you should see the Font Page (landing screen):Landing Screen
The app opens to a landing page where users can choose their login type:
- Admin/Staff Login: For administrators and staff members
- Customer Login: For customers to track their shipments
Admin Login
Try logging in with admin credentials:
- Navigate to Admin Login
- Enter your admin username and password
- Access the admin dashboard
Development Tools
While the app is running, you have access to powerful development tools:Hot Reload
Make changes to your code and pressr in the terminal to hot reload:
Flutter DevTools
Launch DevTools for debugging:v in the terminal running flutter run to open DevTools.
Logging
View detailed logs:Common Issues
Build fails with Gradle error
Build fails with Gradle error
Solution: Update Gradle and dependencies
iOS build fails with CocoaPods error
iOS build fails with CocoaPods error
Solution: Update and reinstall pods
Permission denied errors
Permission denied errors
Solution: The app requires camera and storage permissions
- Grant permissions when prompted on first launch
- On Android: Go to Settings > Apps > App Courier > Permissions
- On iOS: Go to Settings > App Courier > Enable required permissions
API connection fails
API connection fails
Solution: Check your API configuration
- Verify the API endpoint in
lib/core/api/api_client.dart:10 - Ensure your device has internet connectivity
- Check that the backend server is running and accessible
- Verify there are no firewall or network restrictions
App crashes on startup
App crashes on startup
Solution: Clear cache and rebuild
Next Steps
Now that you have the app running, explore these resources:Installation Guide
Learn about detailed setup and configuration options
Architecture
Understand the app’s architecture and design patterns
API Reference
Explore the backend API endpoints
Configuration
Configure API connection
Running in Production
To build a release version of the app:Before building for production, ensure you’ve:
- Updated version numbers in
pubspec.yaml - Configured signing certificates
- Set production API endpoints
- Tested thoroughly on multiple devices