Skip to content
pubscout

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.

$ flutter pub add mobility_features
Source repository

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.

Works with

Packages commonly used together with mobility_features: ones it builds on, ones built on it, and its own family.