FleetTax Documentation

Complete technical documentation for the FleetTax Vahan road tax tracker application.

πŸ“‹ Table of Contents

πŸ“– Project Overview

FleetTax is a fully offline Android application built with Flutter that enables bus and truck fleet owners to efficiently track Vahan road tax payment deadlines. The app eliminates manual tracking by automatically calculating tax expiry dates, sending daily push notifications, and providing direct integration with the Vahan portal.

Key Objectives

✨ Core Features

Vehicle Management

Dashboard & Tracking

Notification System

Status Color Coding

Status Color Meaning
Expired Red (#FF0044) Tax payment is overdue
Due Soon Orange (#FF6B35) Tax expires within 10 days
Valid Green (#00E676) Tax payment is current

πŸ› οΈ Technology Stack

Frontend Framework

Flutter 3.x: Cross-platform mobile framework with native-like performance and hot reload

Programming Language

Dart 3.x: Modern, statically-typed language with async/await support

State Management

Provider: Lightweight, reactive state management with automatic UI rebuilds

Database

SQLite: Embedded relational database with zero configuration

Background Tasks

WorkManager: Reliable background job scheduling that survives app restart

Additional Libraries

πŸ—οΈ Architecture

Project Structure

lib/ β”œβ”€β”€ main.dart # App entry point β”œβ”€β”€ models/ β”‚ └── vehicle.dart # Vehicle data model β”œβ”€β”€ db/ β”‚ └── database_helper.dart # SQLite operations β”œβ”€β”€ services/ β”‚ β”œβ”€β”€ notification_service.dart # Push notifications β”‚ └── workmanager_service.dart # Background tasks β”œβ”€β”€ providers/ β”‚ └── vehicle_provider.dart # State management β”œβ”€β”€ screens/ β”‚ β”œβ”€β”€ dashboard_screen.dart # Main view β”‚ β”œβ”€β”€ add_edit_screen.dart # Form β”‚ └── mark_paid_screen.dart # Payment entry └── widgets/ β”œβ”€β”€ vehicle_card.dart # Vehicle tile β”œβ”€β”€ stats_bar.dart # Statistics └── filter_chips.dart # Filters

Architectural Patterns

πŸ—„οΈ Database Schema

CREATE TABLE vehicles ( id INTEGER PRIMARY KEY AUTOINCREMENT, reg TEXT NOT NULL, type TEXT NOT NULL, tax_period TEXT NOT NULL, last_paid TEXT NOT NULL, notes TEXT, receipt_ref TEXT, created_at TEXT NOT NULL );

Column Descriptions

Column Type Description
id INTEGER Primary key, auto-incrementing
reg TEXT Vehicle registration number
type TEXT 'bus' or 'truck'
tax_period TEXT 'monthly', 'quarterly', or 'yearly'
last_paid TEXT ISO 8601 date (YYYY-MM-DD)
notes TEXT Optional notes
receipt_ref TEXT Optional receipt reference
created_at TEXT Creation timestamp

πŸš€ Installation Guide

Prerequisites

Step 1: Clone Repository

git clone https://github.com/DevanshSrajput/FleetTax.git cd FleetTax

Step 2: Install Dependencies

flutter pub get

Step 3: Verify Setup

flutter doctor

Step 4: Run Application

# List available devices flutter devices # Run on specific device flutter run -d <device-id>

πŸ“¦ Building for Production

Release APK Build

flutter build apk --release

Output: build/app/outputs/flutter-apk/app-release.apk

Android Permissions

Ensure android/app/src/main/AndroidManifest.xml includes:

<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/> <uses-permission android:name="android.permission.INTERNET"/>

πŸ”” Notification System

How It Works

  1. App initializes NotificationService on launch
  2. WorkManager registers a daily background task
  3. Every 24 hours, the system checks all vehicles
  4. If daysLeft ≀ 10, a notification is triggered
  5. Process continues until vehicle is marked as paid

Notification Permissions (Android 13+)

πŸ› Troubleshooting

Notifications Not Showing

Cause: Permission not granted at runtime

Solution: Go to Settings β†’ Apps β†’ FleetTax β†’ Enable Notifications

WorkManager Not Firing

Cause: Android power management killing background tasks

Solution: Allow background activity in battery settings for FleetTax

SDK Not Found

Solution: Run flutter doctor and follow recommendations

MissingPluginException

flutter clean flutter pub get flutter run

App Crashes on Launch

Solution: Check flutter logs for full error trace

πŸ“š API Reference

Vehicle Class

Key Methods

VehicleProvider

Key Methods

DatabaseHelper

Key Methods

πŸ—ΊοΈ Roadmap

Version 1.0 (Current) βœ…

Version 2.0 (Planned)

πŸ“„ Download Full LaTeX Documentation
← Back to Home