mobility_features
6.2.1, released 2 months ago by carp.dk
Calculates real-time mobility features like places, stops, and home stay from location data.
What it does
Processes location sample streams to compute mobility metrics such as significant places, stops, moves, home stay, location entropy, and distance traveled. It runs as a singleton and relies on an external location plugin for raw GPS data.
AI-written summary of version 6.2.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to derive real-time mobility analytics and behavioral features from phone location history.
- You are already capturing background location updates and want to analyze stops, places, and home stay.
Skip it when
- You just need a basic map view or simple geolocation coordinates without analytics.
- You cannot guarantee that your app has persistent background location permissions (ALWAYS access).
Strengths
- Provides complex derived metrics like location entropy and home stay out of the box.
- Stream-based architecture integrates cleanly with background location streams.
Weaknesses
- Does not handle OS location permissions or raw data collection natively; requires a separate location plugin.
- Feature calculations can result in fallback values (-1.0) if prerequisites (like nighttime data or minimum places) are not met.
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- Yes (build_runner)
- Direct dependencies
- 5
Requires an external location plugin (like carp_background_location) to supply location samples, plus explicit OS-level permissions for background location access.
MobilityFeatures().stopDuration = Duration(seconds: 20);
MobilityFeatures().placeRadius = 50;
MobilityFeatures().stopRadius = 5.0;
MobilityFeatures().startListening(locationSampleStream);
mobilitySubscription = MobilityFeatures().contextStream.listen((context) {
print('Context received: ${context.toJson()}');
});Alternatives
Packages that do the same job and could replace mobility_features.
- flutter_map_math
Utility library for common geospatial calculations in Flutter
44Compare
Works with
Packages commonly used together with mobility_features: ones it builds on, ones built on it, and its own family.
- json_annotationmobility_features depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- path_providermobility_features depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- carp_serializablemobility_features depends on itPolymorphic JSON (de)serialization using json_serializable with type info.
- statsmobility_features depends on itCalculate common statistical values for a set of numbers.
- healthSame familyWrapper for Apple's HealthKit and Google's Health Connect.
- research_packageSame familyA Flutter framework for obtaining informed consent, showing surveys and collecting results.
- carp_mobile_sensingSame familyMobile sensing framework for collecting sensor and device data via configurable probes.
- carp_health_packageSame familySamples health data from Apple Health and Google Health Connect for CARP Mobile Sensing.