accurate_step_counter
Production-grade step counter for Flutter Android. TYPE_STEP_COUNTER foreground service on all API 24+, production-hardened rate caps and merge policies, SQLite logging, midnight/boot recovery, and BYO Health Connect smart merge.
What this package is like to depend on
Last release 26 days ago
28 Jul 2026
Ships unpredictably
gaps range from 8 days to 5 months
Rarely documented
notes for 9 of 39 stable releases
Nothing withdrawn
no release was ever pulled
9 months old
39 releases · first in 2025
39 releases in the last 12 months
see the full history below
Release timeline
39 releases · Nov 2025 to Jul 2026Releases
latest 39-
3.1.028 Jul 2026Release notes
Open source →Added
- iOS support via HealthKit (
healthpackage) with filtered step reads and HC smoothing semantics aligned with meltdown. - New internal
IosHealthStepDetectorservice that emits realtime step events from Health app totals. - Cross-platform example flow now handles iOS initialization cleanly.
Changed
watchTodaySteps()remains immediate and floor-protected while now supporting iOS live step source.- Package positioning updated from Android-only to Android + iOS HealthKit.
Fixed
- Native event merge now always applies floor protection before emitting (prevents downward jitter on transient resets).
- Rotation drain persists previous day totals into SQLite with date anchoring.
- iOS support via HealthKit (
-
3.0.026 Jul 2026Release notes
Open source →Breaking
- Primary detection is now TYPE_STEP_COUNTER FGS on all Android API 24+ (including Samsung). Previous API≤29 / non-Samsung gate removed.
SmartMergeHelper.mergeStepCountssemantics changed — no longer naivemax(). UsesStepLogic(HC duplication band, sensor overcount at 1.10×, HC can correct downward, server floor). PreferSmartMergeHelper.merge()for fullMergeDecisionflags.- Legacy auto-start of
StepCounterForegroundServiceon app termination is off by default to prevent dual-FGS fights. StepDetectorConfig.useForegroundServiceOnOldDevicesdefaults to false (legacy sensors_plus fallback only).
Added
- Production-hardened
StepCounterService: prefs persist, reboot detect, burst/minute/hour caps with baseline fold-in, vehicle/bicycle Activity Recognition filter, TYPE_STEP_DETECTOR cross-check, exact midnight alarm, BootReceiver, TimeChangeReceiver, rotation stamps ActivityClassifier+ soft-fail without Play Services (play-services-location)- Dart policies:
StepLogic,MergePolicy,smoothHcReading,RotationGuard,StepRateLimiter - Platform APIs:
setNotificationDisplay,forceUpdateTodaySteps,consumeLastRotation,resetNativeStepState startTracking()— one-call setup (DB + FGS + aggregated logging)- Short aliases:
isBatteryOptimized(),requestBatteryOptimization() - Safe calibration from SQLite today (sensor=0, seed ≤40k) on start
- Native↔SQLite reconcile on aggregated start (fixes undercount after process death)
- Rotation drain on start / resume / step stream
- Ported production policy unit tests under
test/policy/ - Soft
uses-featurefor stepcounter/stepdetector (required=false) - Consumer ProGuard keep rules for services/receivers
Fixed (production DX / hardening)
- Skip legacy terminated-prefs sync when the native FGS is available (no dual recovery)
- Example + verification check TYPE_STEP_COUNTER FGS, not fallback detector
- Removed 500ms artificial delay from
initSteps(now aliasesstartTracking) - Collapsed duplicate
getTodaySteps/getYesterdayStepsdefinitions - Cold-start day-gap restore stamps
KEY_LAST_ROTATION_*and persists rotated prefs - Activity Recognition PendingIntent uses explicit component + unique request code; receiver in manifest
- Removed Play-risk permissions
USE_EXACT_ALARM,BODY_SENSORS,BODY_SENSORS_BACKGROUND,HIGH_SAMPLING_RATE_SENSORS - Plugin no longer permanently registers a second
TYPE_STEP_COUNTERlistener (battery) - Kotlin unit test matches real MethodChannel API
NotificationChannelcreation guarded for API 24–25 (StepCounterService)dispose()/stopLogging()flush write buffer and cancel flush timer
Migration
- Bump to
^3.0.0and requestACTIVITY_RECOGNITION+ notifications beforestartTracking(). - Prefer
await steps.startTracking()over the old three-call sequence. - If you relied on naive max merge, switch to
SmartMergeHelper.merge(...)and handleMergeDecision. - Keep notification synced with
setNativeNotificationDisplay(merged)— do not force-write merged HC into sensor baseline. - Supply HC/server yourself (BYO); package does not embed Health Connect SDK.
-
2.0.028 Feb 2026Release notes
Open source →Major: Native Step Service + Smart Merge
This release promotes the native
TYPE_STEP_COUNTERforeground service as the primary detection strategy and adds the SmartMergeHelper utility for combining multiple step sources.Added
- SmartMergeHelper — combine sensor + Health Connect + server (naive max in 2.x)
- Native Step Service Status API —
isNativeStepServiceRunning(),isUsingNativeStepService
Changed
- VERSION BUMP to 2.0.0
- README rewritten for TYPE_STEP_COUNTER architecture
Fixed
StepCounterService.kt— addedisRunningflag
Removed
- Stale Hive artifacts
-
1.9.522 Feb 2026Release notes
Open source →Fixed
- Background isolate
sqfliteinitialization error — AddedDartPluginRegistrant.ensureInitialized()to isolate entry point
- Background isolate
-
1.9.422 Feb 2026Release notes
Open source →Added
- Terminated sync gap reconciliation with idempotent deterministic gap keys
- Single-flight terminated sync to prevent concurrent reprocessing
- Production example flow in example app
-
1.9.303 Feb 2026Release notes
Open source →Added
- Automatic 30-day log retention policy
- Database write batching (3-second buffer)
- Background isolate for database operations (
StepRecordConfig.lowEndDevice()) - Stream emission throttling (max 10Hz)
-
1.9.128 Jan 2026Release notes
Open source →Verified
- ANR-safe architecture audit: all Kotlin I/O on
Dispatchers.IO, async SharedPreferences, background SQLite
- ANR-safe architecture audit: all Kotlin I/O on
-
1.9.028 Jan 2026Release notes
Open source →Changed
- Database migration: Hive → sqflite — Indexed SQL queries, smaller footprint, no code generation needed
Removed
- Hive dependencies (
hive,hive_flutter,hive_generator,build_runner)
-
1.8.1228 Jan 2026 -
1.8.1128 Jan 2026Nothing published for this version
-
1.8.1027 Jan 2026Nothing published for this version
-
1.8.921 Jan 2026Nothing published for this version
-
1.8.820 Jan 2026Nothing published for this version
-
1.8.720 Jan 2026Nothing published for this version
-
1.8.519 Jan 2026Nothing published for this version
-
1.8.419 Jan 2026Nothing published for this version
-
1.8.314 Jan 2026Nothing published for this version
-
1.8.213 Jan 2026Nothing published for this version
-
1.8.112 Jan 2026Nothing published for this version
-
1.8.011 Jan 2026Nothing published for this version
-
1.7.809 Jan 2026Nothing published for this version
-
1.7.709 Jan 2026Nothing published for this version
-
1.7.609 Jan 2026Nothing published for this version
-
1.7.509 Jan 2026Nothing published for this version
-
1.7.408 Jan 2026Nothing published for this version
-
1.7.308 Jan 2026Nothing published for this version
-
1.7.208 Jan 2026Nothing published for this version
-
1.7.108 Jan 2026Nothing published for this version
-
1.7.008 Jan 2026Nothing published for this version
-
1.6.008 Jan 2026Nothing published for this version
-
1.5.007 Jan 2026Nothing published for this version
-
1.4.007 Jan 2026Nothing published for this version
-
1.3.107 Jan 2026Nothing published for this version
-
1.3.007 Jan 2026Nothing published for this version
-
1.2.102 Jan 2026Nothing published for this version
-
1.2.030 Dec 2025Nothing published for this version
-
1.1.103 Dec 2025Nothing published for this version
-
1.1.027 Nov 2025Nothing published for this version
-
1.0.020 Nov 2025Nothing published for this version