JYearPicker constructor

JYearPicker({
  1. Key? key,
  2. HijriDate? currentDate,
  3. required HijriDate firstDate,
  4. required HijriDate lastDate,
  5. HijriDate? initialDate,
  6. required HijriDate selectedDate,
  7. required ValueChanged<HijriDate> onChanged,
  8. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
})

Creates a year picker.

The firstDate, lastDate, selectedDate, and onChanged arguments must be non-null. The lastDate must be after the firstDate.

Implementation

JYearPicker({
  super.key,
  HijriDate? currentDate,
  required this.firstDate,
  required this.lastDate,
  HijriDate? initialDate,
  required this.selectedDate,
  required this.onChanged,
  this.dragStartBehavior = DragStartBehavior.start,
})  : assert(!firstDate.dateTime.isAfter(lastDate.dateTime)),
      currentDate = currentDate ?? HijriDate.now(),
      initialDate = initialDate ?? selectedDate;