RelativePeriod class
Relative period - a duration from reference time.
By default, extends into the past. Use direction to change this:
- PeriodDirection.past: "last N units" (default)
- PeriodDirection.future: "next N units"
- PeriodDirection.around: "N units before and after"
Constructors
- RelativePeriod({required PeriodUnit unit, required int value, PeriodDirection direction = PeriodDirection.past})
-
const
-
RelativePeriod.fromJson(Map<
String, dynamic> json) -
factory
Properties
- direction → PeriodDirection
-
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unit → PeriodUnit
-
final
- value → int
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
[DateTime? referenceTime]) → DateRange -
Resolve to DateRange at the given reference time.
override
-
toJson(
) → Map< String, dynamic> -
Convert to JSON.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override