android_sleep_tracker 0.0.1 copy "android_sleep_tracker: ^0.0.1" to clipboard
android_sleep_tracker: ^0.0.1 copied to clipboard

PlatformAndroid

Flutter API over Android's native sleep tracking (Google Play Services Activity Recognition Sleep API). Android-only, no UI, no health scoring.

Changelog #


0.0.1 #

  • Initial release.
  • AndroidSleepTracker: startTracking(), stopTracking(), isTracking(), getLatestSleep(), clearHistory().
  • Backed by Google Play Services' Activity Recognition Sleep API (Android-only, minSdkVersion 24+).
  • Added sleepDataStream: a broadcast Stream<SleepApiEvent> pushing raw SleepSegmentEvent/SleepClassifyEvent data live via a new android_sleep_tracker/events EventChannel, on top of the existing pull-based getLatestSleep(). New models SleepApiEvent/SleepSegmentReceived/SleepClassifyReceived/SleepSegmentStatus.
  • SleepSession/SleepStage models, with a coarse, best-effort sleepStages guess derived from SleepClassifyEvent confidence samples — correctly handles SleepClassifyEvent broadcasts and skips STATUS_NOT_DETECTED segments instead of persisting bogus zero-duration sessions.
  • Typed exceptions for unsupported devices, denied permissions, and other native failures (SleepTrackerUnsupportedException, SleepTrackerPermissionDeniedException, SleepTrackerPlatformException) — callers never see a raw PlatformException.
1
likes
160
points
68
downloads

Documentation

API reference

Publisher

verified publisherdashstack.tech

Weekly Downloads

Flutter API over Android's native sleep tracking (Google Play Services Activity Recognition Sleep API). Android-only, no UI, no health scoring.

Repository (GitHub)
View/report issues

Topics

#android #sleep #health #sensors

License

MIT (license)

Dependencies

flutter

More

Packages that depend on android_sleep_tracker

Packages that implement android_sleep_tracker