Skip to content
pubscout

pedometer

4.2.0, released 9 months ago by cachet.dk

A Pedometer and Step Detection package for Android and iOS.

$ flutter pub add pedometer
Source repository

What it does

Allows for continuous step counting and pedestrian status using built-in pedometer sensor APIs on iOS and Android devices. Step counts and pedestrian status are streamed as platform updates occur.

AI-written summary of version 4.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to track step counts continuously in your app
  • You need to detect pedestrian status (walking or stopped)

Skip it when

  • Targeting older phones or specific Samsung devices that do not support step count or pedestrian status sensors
  • You need historical step counts from before application installation on Android

Strengths

  • Provides real-time step count streaming
  • Supports pedestrian status detection (walking vs stopped)
  • Cross-platform support for both Android and iOS

Weaknesses

  • Sensor availability varies across device models (some Samsung and older iPhones lack support)
  • Requires manual platform configuration and permission handling

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
0

Requires adding the ACTIVITY_RECOGNITION permission for Android 10+ and NSMotionUsageDescription along with UIBackgroundModes to iOS Info.plist.

Stream<StepCount> _stepCountStream;
Stream<PedestrianStatus> _pedestrianStatusStream;

void onStepCount(StepCount event) {
  int steps = event.steps;
  DateTime timeStamp = event.timeStamp;
}

void onPedestrianStatusChanged(PedestrianStatus event) {
  String status = event.status;
  DateTime timeStamp = event.timeStamp;
}

Future<void> initPlatformState() async {
  _pedestrianStatusStream = await Pedometer.pedestrianStatusStream;
  _stepCountStream = await Pedometer.stepCountStream;
  _stepCountStream.listen(onStepCount);
  _pedestrianStatusStream.listen(onPedestrianStatusChanged);
}

Alternatives

Packages that do the same job and could replace pedometer.

Works with

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