pickerDate static method

void pickerDate(
  1. BuildContext context,
  2. DateChangedCallback onConfirm, {
  3. DateChangedCallback? onChange,
  4. DateCancelledCallback? onCancel,
  5. DateTime? currentTime,
})

Implementation

static void pickerDate(BuildContext context, DateChangedCallback onConfirm,
    {DateChangedCallback? onChange, DateCancelledCallback? onCancel,DateTime? currentTime}) {
  DatePicker.showDatePicker(context,
      showTitleActions: true,
      minTime: DateTime(1900, 1, 1),
      maxTime: DateTime(2100, 1, 1),
      currentTime: currentTime == null
          ? DateTime.now()
          : currentTime,
      onChanged: onChange,
      onConfirm: onConfirm,
      onCancel: onCancel,
      locale: LocaleType.zh);
}