showDatePicker static method
      
Future
showDatePicker({ 
    
    
- required BuildContext context,
- required DateController controller,
- bool barrierDismissible = true,
- double height = 500,
- double width = 400,
- int totalYears = 110,
- int forwardYears = 50,
- double vGap = 16,
- BoxDecoration? pickerDecoration,
- DateTime? initStartDate,
- DateTime? initEndDate,
- double pickerVisibilityHeight = 140,
- double itemExtent = 40,
- double maskHeight = 40,
- double itemWidth = 100,
- double maskRadius = 0,
- double? diameterRatio,
- Color? backgroundColor,
- double? offAxisFraction,
- bool? useMagnifier,
- double? magnification,
- double? squeeze,
- Widget? selectionOverlay,
- Color? maskColor = const Color.fromRGBO(242, 242, 244, 0.7),
- Duration duration = const Duration(milliseconds: 200),
- Curve curve = Curves.easeInOutCubic,
- List<DateType> showColumn = const [DateType.year, DateType.month, DateType.day, DateType.hour, DateType.minute, DateType.second],
- DatePickerStrings? datePickerStrings,
- Widget? title,
- TextStyle? itemTextStyle,
- Widget? actions,
- dynamic callBack()?,
Implementation
static Future<dynamic> showDatePicker(
    {
      required BuildContext context,
      required DateController controller,
      bool barrierDismissible = true,
      double height = 500,
      double width = 400,
      int totalYears = 110,
      int forwardYears = 50,
      double vGap = 16,
      BoxDecoration? pickerDecoration,
      DateTime? initStartDate,
      DateTime? initEndDate,
      double pickerVisibilityHeight = 140,
      double itemExtent = 40,
      double maskHeight = 40,
      double itemWidth = 100,
      double maskRadius = 0,
      double? diameterRatio,
      Color? backgroundColor,
      double? offAxisFraction,
      bool? useMagnifier,
      double? magnification,
      double? squeeze,
      Widget? selectionOverlay,
      Color? maskColor = const Color.fromRGBO(242, 242, 244, 0.7),
      Duration duration = const Duration(milliseconds: 200),
      Curve curve = Curves.easeInOutCubic,
      List<DateType> showColumn = const [
        DateType.year,
        DateType.month,
        DateType.day,
        DateType.hour,
        DateType.minute,
        DateType.second
      ],
      DatePickerStrings? datePickerStrings,
      Widget? title,
      TextStyle? itemTextStyle,
      Widget? actions,
      Function(DateTime? startDate, DateTime? endDate)? callBack,
    }) {
  final strings = datePickerStrings ?? DatePickerStrings.fromLocale(Localizations.localeOf(context));
  return showDialog(
    context: context,
    barrierDismissible: barrierDismissible,
    builder: (context) {
      return Center(child:
      SizedBox(
        width: width,
        child: DatePicker(
          controller: controller,
          pickerDecoration: pickerDecoration,
          height: height,
          totalYears: totalYears,
          initStartDate: initStartDate,
          initEndDate: initEndDate,
          forwardYears: forwardYears,
          vGap: vGap,
          pickerVisibilityHeight: pickerVisibilityHeight,
          itemExtent: itemExtent,
          itemWidth: itemWidth,
          maskHeight: maskHeight,
          maskRadius: maskRadius,
          maskColor: maskColor,
          diameterRatio: diameterRatio,
          backgroundColor: backgroundColor,
          offAxisFraction: offAxisFraction,
          useMagnifier: useMagnifier,
          magnification: magnification,
          squeeze: squeeze,
          selectionOverlay: selectionOverlay,
          duration: duration,
          curve: curve,
          showColumn: showColumn,
          startWidget:title?? Padding( // Using strings.startDate
            padding: const EdgeInsets.only(left: 20),
            child: Text(strings.pleaseSelect,
                style: const TextStyle(
                    color: Colors.black,
                    fontSize: 18,
                    fontWeight: FontWeight.bold)),
          ),
          itemBuilder: (type, value) {
            String label = '';
            switch (type) { // Using strings for year, month, day, etc.
              case DateType.year:
                label = strings.year;
                break;
              case DateType.month:
                label = strings.month;
                break;
              case DateType.day:
                label = strings.day;
                break;
              case DateType.hour:
                label = strings.hour;
                break;
              case DateType.minute:
                label = strings.minute;
                break;
              case DateType.second:
                label = strings.second;
                break;
            }
            return Center(
              child: Text(
                "$value$label",
                style:itemTextStyle?? const TextStyle(
                    color: Color.fromRGBO(21, 21, 21, 1),
                    fontSize: 16,
                    fontWeight: FontWeight.bold),
              ),
            );
          },
          action: actions??GestureDetector(
            onTap: () {
              final startDate = controller.getStartDate();
              final endDate = controller.getEndDate();
              callBack?.call(startDate, endDate);
              Navigator.pop(context, [startDate, endDate]);
            },
            child: Center(
              child: Container(
                padding: const EdgeInsets.symmetric(horizontal: 40, vertical: 10),
                decoration: BoxDecoration(
                  color: Colors.lightBlueAccent,
                  borderRadius: BorderRadius.circular(20),
                ),
                child: Text(strings.confirm, // Using strings.confirm
                    style: const TextStyle(color: Colors.white, fontSize: 16)),
              ),
            ),
          ),
        ),
      )
      );
    },
  );
}