locus
2.6.0, released 10 days ago by weorbis.com
Background geolocation SDK for Flutter with tracking, geofencing, activity recognition and HTTP sync
What it does
Provides continuous background location updates, activity detection, geofencing (circular and polygon), privacy zones, trip detection, and optional HTTP sync. Data is persisted locally in SQLite and can be queried with native filtering and pagination.
AI-written summary of version 2.5.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need reliable background location tracking on Android and iOS
- You require geofencing with enter/exit/dwell events
- You want activity recognition (walking, running, driving)
- You need to sync location data to a backend with retry and batching
Skip it when
- You only need simple foreground location updates
- You are building a web or desktop app
- You prefer a lightweight package without native code
Strengths
- Deterministic service-based API
- Full test suite and production-ready tooling
- Supports polygon geofences and privacy zones
- Built-in HTTP sync with retry and batching
Weaknesses
- Requires native setup (permissions, Gradle/Pod changes)
- Large plugin footprint due to native code
- No support for web/desktop
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 3
Add permissions in AndroidManifest and Info.plist, run `dart run locus:setup` for native config, initialize with `Locus.ready()` before starting tracking
```dart
import 'package:locus/locus.dart';
void main() async {
await Locus.ready(ConfigPresets.balanced);
await Locus.start();
Locus.location.stream.listen((loc) {
print('Lat: ${loc.coords.latitude}, Lng: ${loc.coords.longitude}');
});
}
```Alternatives
Packages that do the same job and could replace locus.
- geolocator
Simpler foreground tracking without native background support
97Compare - google_maps_flutter
Provides map UI but not background tracking or geofencing
90Compare
Works with
Packages commonly used together with locus: ones it builds on, ones built on it, and its own family.
- argslocus depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- logginglocus depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- permission_handlerlocus depends on itCross-platform API to check and request permissions on iOS, Android, Web, and Windows.