android_sleep_tracker 0.0.1
android_sleep_tracker: ^0.0.1 copied to clipboard
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 broadcastStream<SleepApiEvent>pushing rawSleepSegmentEvent/SleepClassifyEventdata live via a newandroid_sleep_tracker/eventsEventChannel, on top of the existing pull-basedgetLatestSleep(). New modelsSleepApiEvent/SleepSegmentReceived/SleepClassifyReceived/SleepSegmentStatus. SleepSession/SleepStagemodels, with a coarse, best-effortsleepStagesguess derived fromSleepClassifyEventconfidence samples — correctly handlesSleepClassifyEventbroadcasts and skipsSTATUS_NOT_DETECTEDsegments 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 rawPlatformException.