YearPicker constructor

YearPicker({
  1. Key? key,
  2. Jalali? currentDate,
  3. required Jalali firstDate,
  4. required Jalali lastDate,
  5. @Deprecated('This parameter has no effect and can be removed. Previously it controlled ' 'the month that was used in "onChanged" when a new year was selected, but ' 'now that role is filled by "selectedDate" instead. ' 'This feature was deprecated after v3.13.0-0.3.pre.') Jalali? initialDate,
  6. required Jalali? selectedDate,
  7. required ValueChanged<Jalali> onChanged,
  8. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
})

Creates a year picker.

The lastDate must be after the firstDate.

Implementation

YearPicker({
  super.key,
  Jalali? currentDate,
  required this.firstDate,
  required this.lastDate,
  @Deprecated(
    'This parameter has no effect and can be removed. Previously it controlled '
    'the month that was used in "onChanged" when a new year was selected, but '
    'now that role is filled by "selectedDate" instead. '
    'This feature was deprecated after v3.13.0-0.3.pre.'
  )
  Jalali? initialDate,
  required this.selectedDate,
  required this.onChanged,
  this.dragStartBehavior = DragStartBehavior.start,
}) : assert(!firstDate.isAfter(lastDate)),
     currentDate = PersianDateUtils.dateOnly(currentDate ?? Jalali.now());