DatepickerPreset class

A DatepickerPreset represents an option for selecting a predefined date range in material-date-range-picker.

Presets can optionally include alternatives: a list of other related presets that can be selected in a dropdown menu.

Constructors

DatepickerPreset(String title, DatepickerDateRange range, {String shortTitle = '', List<DatepickerPreset> alternatives = const []})
Create a DatepickerPreset.
DatepickerPreset.fromRange(DatepickerDateRange range)
Create a DatepickerPreset based on a DatepickerDateRange.
factory
DatepickerPreset.lastWeek(Clock clock, {int? startWeekday, List<int>? validStartWeekdays})
Create a DatepickerPreset for selecting "Last week".
factory
DatepickerPreset.thisWeek(Clock clock, {int? startWeekday, List<int>? validStartWeekdays})
Create a DatepickerPreset for selecting "This week".
factory

Properties

alternatives List<DatepickerPreset>
An optional list of related presets to display in a dropdown menu.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
range DatepickerDateRange
The date range to select when the preset is selected.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shortTitle String
An optional short label for the preset (e.g. "Mon - Sun").
getter/setter pair
title String
The label to display for the preset (e.g. "Last week (Sun - Sat)").
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