smart_location 3.1.0
smart_location: ^3.1.0 copied to clipboard
Smart Location is a powerful, battery-conscious Flutter plugin for continuous background geolocation tracking, advanced geofencing, and motion-aware updates.
Smart Location 🌍 #
The absolute most scalable, resilient location tracking package for Flutter.
Whether you are building a simple weather app or a military-grade delivery logistics platform, smart_location scales perfectly with your needs.
🚀 Two Tiers of Power #
To keep things simple, smart_location is designed with two tiers.
Use Tier 1 if you are a beginner or just need simple tracking. Use Tier 2 if you are building an enterprise application.
🟢 Tier 1: SmartLocationLite (Beginners & Simple Apps) #
If you are building a weather app, dating app, or simple run tracker, use SmartLocationLite. It is incredibly lightweight, battery-friendly, and simple to use.
import 'package:smart_location/smart_location.dart';
// Get a single location
final myLocation = await SmartLocationLite.getCurrentLocation();
print("I am at: ${myLocation.latitude}, ${myLocation.longitude}");
// Track movement in the foreground
final sub = SmartLocationLite.trackMovement().listen((location) {
print("I am moving: ${location.latitude}");
});
That's it! No complex managers, no battery drain.
🔴 Tier 2: Enterprise Logistics (Delivery, Ride-Sharing) #
If you are building Uber, Doordash, or a fleet tracking system, you need the heavy artillery. The SmartLocation enterprise managers provide Anti-Spoofing, Dead Reckoning, Headless Background Sync, and more.
1. Dead Reckoning (Tunnel Tracking)
When a driver enters a tunnel and loses GPS, the engine seamlessly maintains their tracking position.
SmartLocation.deadReckoning.start(
gpsStream: myStream,
knownRoute: myGoogleMapsPolyline,
onUpdate: (loc) => print("Tracking safely in the tunnel..."),
);
2. Anti-Spoofing Engine
Automatically detect and block fraudulent location data.
SmartLocation.antiSpoofing.enableStrictChecking();
3. Bring Your Own Database (BYOD) & Sync Engine
Don't get bottlenecked by standard storage. Inject your own high-performance offline database for military-grade encrypted writes when syncing massive coordinate batches in the background.
SmartLocation.offlineStore = OfflineLocationStore(myLocalDatabase);
SmartLocation.syncEngine.startBackgroundSync(batchSize: 100);
4. Journey Management & Off-Route Detection
Perfect for delivery and logistics. Define waypoints and get instantly alerted if your driver deviates from the optimized route.
SmartLocation.journeyManager.startJourney([warehouse, dropoff1, dropoff2]);
SmartLocation.offRouteDetector.listen((deviation) {
print("Driver is off route by ${deviation.distance} meters!");
});
5. Driver Safety (Crash & Speed Monitoring)
Automatically detect severe vehicle impacts and enforce driver speed limits.
SmartLocation.crashDetector.onCrashDetected.listen((crashData) {
EmergencyAPI.notifyDispatch(crashData);
});
SmartLocation.speedMonitor.setLimit(65.0); // mph
6. Indoor Positioning
Maintain highly accurate tracking even when deep inside warehouses, parking garages, or multi-story malls.
SmartLocation.indoorBeaconConnector.scanAndConnect(
knownBeacons: myWarehouseBeacons,
fallbackToGPS: true,
);
7. Time-Gated & Predictive Geofencing
Save battery by applying active operational hours to your geofences. Let our statistical engine automatically spawn geofences at predicted destinations ahead of time based on learned user movement patterns!
8. On-Device Route Learning Engine (ML)
A purely on-device statistical learning engine that adapts to user driving patterns to predict highly accurate ETAs for specific route segments, preventing the need for costly Maps API network calls.
🛠 Troubleshooting & Friction #
Are you facing Android Battery Killers, Gradle conflicts, or iOS Podfile issues? We have solved them all!
👉 Read the TROUBLESHOOTING.md Guide
License #
MIT License