TimeRange class
Equivalent of TimeRange from HealthConnectReporter https://github.com/kvs-coder/HealthConnectReporter
A time range in epoch milliseconds, end exclusive.
Throws an InvalidValueException when endTimestamp is not after startTimestamp.
Supports map representation.
Has a TimeRange.fromJson constructor to create instances from JSON payload coming from Android native code.
- Mixed-in types
Constructors
- TimeRange({required int startTimestamp, required int endTimestamp})
- TimeRange.fromDates(DateTime start, DateTime end)
-
The range from
starttoend. -
TimeRange.fromJson(Map<
String, dynamic> json) - General constructor from JSON payload
- TimeRange.lastDays(int days, {DateTime? time})
-
The last
dayscalendar days in local time, including the day oftime(now by default): from midnightdays- 1 days before it to the next midnight.factory
Properties
- endTimestamp → int
-
Epoch milliseconds, exclusive
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
map
→ Map<
String, dynamic> -
General map representation
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startTimestamp → int
-
Epoch milliseconds, inclusive
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