🎯 Smart Location

The most advanced, battery-efficient background location & telematics engine for Flutter.

Pub.dev GitHub stars


smart_location is a highly modular, enterprise-grade mobility suite. Whether you just need simple background tracking or you want to build a full telematics & fleet management app, this package has you covered.

Why choose Smart Location?

  • πŸ”‹ Battery First: Automatically throttles GPS when the phone overheats or battery drops below 15%.
  • πŸ›‘ App Store Safe: Built-in Google Play Prominent Disclosure UI guarantees you won't get rejected.
  • 🧠 AI Telematics: Detects harsh braking and sharp cornering natively using IMU sensors.
  • ⚑ Real-Time: WebSockets and Delta-Encoding save 70% of network bandwidth.

πŸš€ Quick Start (In 2 Minutes)

You don't need to be an expert to get started. Just want background location? Here you go:

1. Request Permissions safely

Avoid App Store & Play Store rejections by using our built-in Prominent Disclosure:

import 'package:smart_location/smart_location.dart';

await smartPermission.requestBackgroundWithProminentDisclosure(
  context: context,
  appName: 'My App',
  justification: 'calculate route distance automatically',
);

2. Start Tracking (Even when killed!)

await NativeEngine.startTracking(
  accuracy: LocationAccuracy.high,
  distanceFilter: 10, // meters
);

That's it! Your app is now tracking in the background natively.


πŸ›  Advanced Features (Modular & Opt-In)

smart_location is completely modular. If you don't use these features, they won't run, keeping your app incredibly lightweight.

🎯 Velocity-Aware Geofencing

Traditional geofences are static. Our geofences dynamically expand based on how fast the user is driving, ensuring your app wakes up before they blow past the destination!

await NativeGeofenceManager.addGeofence(
  id: 'warehouse_1',
  latitude: 37.7749,
  longitude: -122.4194,
  radiusInMeters: 200, // Base radius
);

🏎 ML-Powered Driving Telematics

Detect harsh braking, rapid acceleration, and speeding natively using device IMU sensors (accelerometer & gyroscope). Perfect for insurance and ride-sharing apps.

final telematics = DrivingTelematicsEngine();
telematics.onDrivingEvent.listen((event) {
  print('Detected: ${event.type} (Severity: ${event.severity})');
});

πŸ“‘ Real-Time WebSocket Telemetry

Stop spamming REST APIs. Pipe your live locations directly to a WebSocket. We use Delta Encoding to only send the difference between coordinates, saving 70% of your data bills.

SyncEngine.enableLiveTelemetry('wss://your-fleet-server.com/socket');

πŸ“± Running the Example App

Our example app is a fully-fledged Sandbox featuring a G-Force meter, custom Map styling, and Background configurations!

cd example
flutter run

πŸ›‘ App Store & Play Store Compliance

Background location is heavily scrutinized by Apple and Google. We wrote a dedicated guide to ensure your app gets approved on the first try. πŸ‘‰ Read the Store Compliance Guide here