Skip to main content

What is Trackmart?

Trackmart is a comprehensive delivery management mobile application built with Flutter that enables seamless ordering, real-time tracking, and delivery of goods. The app provides a complete solution for connecting buyers with drivers, managing orders, and tracking deliveries with live map visualization.
Trackmart uses Firebase for backend services and Mapbox for advanced mapping and routing capabilities.

Key Features

Order Management

Place orders with customizable quantities, units (Truck/Tonne), and payment methods (Mobile money/Cash)

Real-time Tracking

Track deliveries in real-time with live driver location updates and ETA calculations

Chat System

Communicate directly with drivers through an integrated messaging system

Authentication

Secure authentication via phone number (SMS verification) or email

Architecture Overview

Trackmart follows a modern Flutter architecture with clear separation of concerns:

Frontend Layer

The app initializes through main.dart with a custom theme and routes to the RootPage for authentication handling.
lib/main.dart
void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: new ThemeData(
        primaryColor: const Color(0xff004d40),
        primaryColorDark: const Color(0xff003e33),
        accentColor: const Color(0xff005B9A),
      ),
      home: RootPage(),
      debugShowCheckedModeBanner: false,
    );
  }
}
The RootPage manages authentication state and routes users to either login or the home page:
lib/root_page.dart
enum AuthStatus { notSignedIn, signedIn, loading }

class RootPageState extends State<RootPage> {
  AuthStatus authStatus = AuthStatus.loading;
  String currentUserId;

  @override
  Widget build(BuildContext context) {
    switch (authStatus) {
      case AuthStatus.notSignedIn:
        return new LoginPage(
          onSignedIn: _signedIn,
          login: this.login,
        );
      case AuthStatus.signedIn:
        return new HomePage(
          onSignedout: _signedOut,
          currentUserId: this.currentUserId,
        );
      case AuthStatus.loading:
        return new Scaffold(
          body: Center(
            child: Icon(Icons.local_shipping, size:120),
          ),
        );
    }
  }
}
The home page features a tabbed interface with three main sections:
  • Chats: Message drivers directly
  • Request: Create new delivery orders
  • Orders: View order history (Requested, In Transit, Delivered)

Backend Services

Used for real-time data synchronization:
  • User profiles (buyers and drivers)
  • Order requests and status updates
  • Live location tracking
  • Driver availability status

Mapping & Location Services

Trackmart integrates Mapbox for superior mapping capabilities and uses Geolocator for precise location tracking.
Core Mapping Features:
  • Real-time route calculation between buyer and driver
  • Distance and duration estimates
  • ETA calculations based on current traffic
  • Live polyline rendering for route visualization
  • Custom markers for buyers and drivers
lib/map.dart
var url = 'https://api.mapbox.com/directions/v5/mapbox/driving/'
          '${dlong},${dlat};${widget.ulong},${widget.ulat}'
          '?access_token=YOUR_MAPBOX_TOKEN';

http.get(url).then((response) {
  route = json.decode(response.body)['routes'][0];
  var k = PolylinePoints().decodePolyline(route['geometry']);
  setState(() {
    points = List.generate(k.length, (i) {
      return LatLng(k[i].latitude, k[i].longitude);
    });
    distance = '${(route['distance'] / 1000).toStringAsFixed(2)}km';
    duration = '${(route['duration'] / 60).toStringAsFixed(0)}min';
  });
});

Tech Stack

CategoryTechnologyVersion
FrameworkFlutterSDK 2.2.0 - 3.0.0
BackendFirebase Auth^0.11.1+7
DatabaseCloud Firestore0.12.7+1
DatabaseFirebase Realtime DB3.0.5
MessagingFirebase Messaging5.1.2
MapsMapbox (via flutter_map)0.7.0+2
LocationGeolocator5.1.1+1
NetworkingDio2.1.13
State ManagementsetState (Built-in)-
This app uses older versions of Flutter packages. Consider upgrading to the latest versions for production use.

Order Workflow

1

User Authentication

Users sign up or log in using phone number or email authentication
2

Driver Selection

Browse available drivers via list or map view with real-time distances and ETAs
3

Order Configuration

Specify quantity, unit type (Truck/Tonne), and payment method
4

Request Delivery

Submit order request to selected driver with calculated pricing
5

Real-time Tracking

Track driver’s location with live map updates and route visualization
6

Order Completion

Receive delivery and rate the service

Next Steps

Quick Start

Get up and running in minutes with step-by-step setup

Firebase Setup

Configure Firebase for authentication and real-time data

Mapbox Integration

Set up Mapbox for location tracking and route visualization

Development Guide

Set up your development environment and start building

Firebase Setup

Configure Firebase services for the app

Mapbox Integration

Set up Mapbox for mapping features

Deployment

Deploy Trackmart to production

Build docs developers (and LLMs) love