SleepSession class

A complete sleep session with stage breakdown.

On Android, stages come from SleepSessionRecord.Stage. On iOS (16+), stages come from HKCategoryValueSleepAnalysis.

Constructors

SleepSession({required DateTime start, required DateTime end, required int durationMinutes, required String source, String device = '', String title = '', String notes = '', required List<SleepStage> stages, required SleepBreakdown breakdown})
const
SleepSession.fromMap(Map<String, dynamic> m)
factory

Properties

breakdown SleepBreakdown
final
device String
final
durationMinutes int
final
efficiency double
Sleep efficiency: ratio of actual sleep to time in bed (0.0–1.0).
no setter
end DateTime
final
hashCode int
The hash code for this object.
no setterinherited
notes String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source String
final
stages List<SleepStage>
final
start DateTime
final
title String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited