An open API service indexing awesome lists of open source software.

https://github.com/krishak15/step-logger

Easy to use step tracker plugin with session history and built-in background support
https://github.com/krishak15/step-logger

flutter flutter-plugin pedometer

Last synced: 4 months ago
JSON representation

Easy to use step tracker plugin with session history and built-in background support

Awesome Lists containing this project

README

          

# Step Logger πŸšΆβ€β™‚οΈ

![Version](https://img.shields.io/badge/pub-v1.0.0--beta.2-blue)
![Platforms](https://img.shields.io/badge/platforms-Android%20%7C%20iOS-blue)

A Flutter plugin for cross-platform step tracking with background support.

## Features

- πŸ“Š Real-time step counting
- πŸ”„ Background service for continuous tracking (Android)
- πŸ“… Historical session data storage
- πŸ”” Customizable notification
- πŸ“± Works in foreground and background
- πŸ”„ Automatic session recovery after app kills

## Platform Support


Feature
Android
iOS


Real-time steps
βœ…
βœ…


Background tracking
βœ…
⚠️ Limited


Session history
βœ…
βœ…


Step accuracy
High
High


Battery impact
Moderate
Low

## Android Setup
### Permissions βš™οΈ

Add to ```android/app/src/main/AndroidManifest.xml```:

```xml

```

## Service declaration

```xml


```

## iOS Setup

### Requirements

1. **Add HealthKit entitlement:**
- In Xcode, go to your target's **Signing & Capabilities**.
- Click "+" and add **HealthKit**.

2. **Add these entries to your `Info.plist`:**

```xml
NSHealthShareUsageDescription
We need access to HealthKit to track your steps
NSHealthUpdateUsageDescription
We need access to HealthKit to save your step data
UIBackgroundModes

fetch
healthkit

NSUserNotificationAlertStyle
alert
```

## iOS Limitations
⚠️ **Important iOS Considerations**

1. **Background step updates require explicit user permission.**
2. **Steps are only recorded when:**
- The app is in the foreground.
- The user has HealthKit background delivery enabled.
- The user opens the app periodically (to sync latest data).

3. **Step data accuracy depends on the device**

4. **Sessions interrupted by app kills will:**
- Persist tracking state.
- Recover steps when the app relaunches.
- Auto-stop sessions older than 12 hours.

> **Note:** iOS does not support true background step tracking services like Android. The plugin uses HealthKit background delivery as a workaround, which depends on system scheduling and user permissions. This means background updates may be delayed or less frequent compared to Android, and step counts are calculated when the app is brought to the foreground.