upDatePicker static method

dynamic upDatePicker(
  1. BuildContext context, {
  2. DateTime? initialDate,
  3. required DateTime firstDate,
  4. required DateTime lastDate,
  5. UpStyle? style,
  6. UpColorType? colorType,
})

Implementation

static upDatePicker(BuildContext context,
    {DateTime? initialDate,
    required DateTime firstDate,
    required DateTime lastDate,
    UpStyle? style,
    UpColorType? colorType}) async {
  return showDatePicker(
    context: context,
    initialDate: initialDate ?? DateTime.now(),
    firstDate: firstDate,
    lastDate: lastDate,
    builder: (BuildContext context, Widget? child) {
      return Theme(
        data: UpStyle.getDatePickerThemeData(context,
            style: style, colorType: colorType),
        child: child ?? const Text(""),
      );
    },
  );
}