YearPicker constructor

YearPicker(
  1. {Key key,
  2. @required DateTime selectedFirstDate,
  3. DateTime selectedLastDate,
  4. @required ValueChanged<List<DateTime>> onChanged,
  5. @required DateTime firstDate,
  6. @required DateTime lastDate}
)

Creates a year picker.

The selectedDate and onChanged arguments must not be null. The lastDate must be after the firstDate.

Rarely used directly. Instead, typically used as part of the dialog shown by showDatePicker.

Implementation

YearPicker({
  Key key,
  @required this.selectedFirstDate,
  this.selectedLastDate,
  @required this.onChanged,
  @required this.firstDate,
  @required this.lastDate,
})  : assert(selectedFirstDate != null),
      assert(onChanged != null),
      assert(!firstDate.isAfter(lastDate)),
      super(key: key);