feature/tracking — Realtime Order Tracking (Shared Module)

Stream driver location and order status updates via Socket.IO events.

Updated Apr 13, 2026
One-click install
npx skills add https://github.com/Vantoan252003/Mozi --skill feature-tracking-realtime-order-tracking-shared-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: feature/tracking — Realtime Order Tracking (Shared Module)
Source: https://github.com/Vantoan252003/Mozi/tree/main/lib/features/tracking
Command: npx skills add https://github.com/Vantoan252003/Mozi --skill feature-tracking-realtime-order-tracking-shared-module

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a unified, real-time tracking system so ride-hailing and food delivery clients can display accurate driver location, ETA, and order status without duplicating socket logic across features, reducing bugs and lifecycle issues.

Core Features & Use Cases

  • Socket room lifecycle: join and leave order-specific Socket.IO rooms to scope updates per order.
  • Event handling: maps driver_location, order_status_changed, eta_updated, and order_cancelled events to a TrackingEntity stream consumed by UI.
  • Shared Bloc integration: a TrackingBloc updates map markers, animates camera conditionally, and transitions states (connecting, active, completed, cancelled, error) while delegating socket access to an injected SocketService.
  • Use Case: In a ride or food flow, start tracking when the user opens the tracking page to show live driver movement and ETA, stop when the page is disposed, and navigate to rating after completion.

Quick Start

Start tracking order 123 of type ride to receive live driver location, ETA, and status updates.

Frequently Asked Questions about feature/tracking — Realtime Order Tracking (Shared Module)

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement realtime order tracking for a Flutter delivery app?

Realtime order tracking in Flutter uses a Socket.IO client to join order-specific rooms and stream driver_location, order_status_changed, and eta_updated events. A TrackingBloc consumes these streams to update map markers and manage UI states like connecting, active, completed, and error.

How does Socket.IO room lifecycle work for tracking active ride-hailing orders?

Socket.IO room lifecycle for ride-hailing tracking involves joining an order-specific room when the tracking page opens and leaving it upon disposal. This scopes realtime driver location and ETA updates to only the active order, preventing duplicated socket logic and lifecycle bugs across features.

Can I use Flutter BLoC to manage live driver location streams and map updates?

Yes, Flutter BLoC manages live driver location streams by delegating socket access to an injected SocketService and mapping events to a TrackingEntity stream. The TrackingBloc updates the map cubit, animates the camera conditionally, and transitions between connecting, active, completed, cancelled, and error states.

What is the best way to handle ETA updates and order cancellation events in a food delivery client?

Handling ETA updates and order cancellations in a food delivery client requires mapping eta_updated and order_cancelled socket events to a TrackingEntity stream. The TrackingBloc consumes this stream to update the UI, navigate to rating upon completion, or display cancellation and error states.

Why do I need an injected SocketService for realtime tracking instead of direct socket connections?

An injected SocketService is required for realtime tracking to centralize socket access and prevent duplicated logic across ride and food delivery features. Delegating socket connections through dependency injection ensures proper lifecycle management, stream handling, and clean repository API integration.

What are the limitations of using Socket.IO for Flutter realtime location tracking?

Socket.IO for Flutter realtime location tracking requires manual room lifecycle management, joining and leaving order-specific rooms to avoid memory leaks. You must handle connection errors, stream disposal on page exit, and state transitions for cancelled or completed orders to prevent UI inconsistencies.