YearPicker constructor
YearPicker({
- Key? key,
- Jalali? currentDate,
- required Jalali firstDate,
- required Jalali 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 Jalali? selectedDate,
- required ValueChanged<
Jalali> onChanged, - 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());