LastNDaysRange class
A range 'N' days long, which ends yesterday (today is not included).
Special-cased to have titles like 'Last 7 days', etc. lengthInDays should be at least 1.
- Inheritance
-
- Object
- MultipleDaysRange
- LastNDaysRange
Constructors
- LastNDaysRange(Date start, int lengthInDays, [String? title])
- LastNDaysRange.beforeToday(dynamic clock, dynamic lengthInDays, [String? title])
Properties
- end → Date
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAllTime → bool
-
true
if this date range represents all available history.no setterinherited - isPredefined → bool
-
Whether the date range is predefined by the application.
no setterinherited
- lengthInDays → int
-
Length of the range in number of days.
no setterinherited
- next → DatepickerDateRange?
-
A date range which begins immediately after this one ends, and has either
the same length or similar semantics (such as "the next month").
no setterinherited
- prev → DatepickerDateRange?
-
A date range which ends immediately before this one starts, and has either
the same length or similar semantics (such as "the previous year").
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- start → Date
-
no setterinherited
- title → String
-
E.g. "Last 7 days", "This month", "Custom", etc.
finalinherited
Methods
-
asPlainRange(
) → DateRange -
Returns this range as a plain DateRange. This is needed because
DateRange's equality is strict on types.
inherited
-
clamp(
{Date? min, Date? max}) → DatepickerDateRange? -
Clamps the current date range to the given min and max dates. Returns null
if this range has no overlap with the given date range.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toProtoBuf(
) → DatepickerDateRange -
Convert this date range into the protocol buffer format defined in
date_range.proto.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unclamped(
) → DatepickerDateRange -
Reverses the effect of one call to clamp() (assuming clamp() didn't return
null). If clamp() succeeds, range.clamp(...).unclamped() == range.
inherited
Operators
-
operator ==(
Object o) → bool -
The equality operator.
inherited