showElevarmDatePickerDialog<T> function

Future<T?> showElevarmDatePickerDialog<T>({
  1. required BuildContext context,
  2. ElevarmDatePickerMode mode = ElevarmDatePickerMode.single,
  3. DateTime? initialDisplayDate,
  4. DateTime? initialSelectedDate,
  5. DateTimeRange? initialSelectedRange,
  6. DateTime? minDate,
  7. DateTime? maxDate,
  8. String positiveButtonLabel = 'Apply',
  9. String negativeButtonLabel = 'Cancel',
  10. List<String> weekNames = const ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sat', 'Su'],
})

Implementation

Future<T?> showElevarmDatePickerDialog<T>({
  required BuildContext context,
  ElevarmDatePickerMode mode = ElevarmDatePickerMode.single,
  DateTime? initialDisplayDate,
  DateTime? initialSelectedDate,
  DateTimeRange? initialSelectedRange,
  DateTime? minDate,
  DateTime? maxDate,
  String positiveButtonLabel = 'Apply',
  String negativeButtonLabel = 'Cancel',
  List<String> weekNames = const ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sat', 'Su'],
}) async {
  return showDialog<T>(
    barrierColor: const Color.fromRGBO(52, 64, 84, 0.7),
    context: context,
    builder: (context) {
      return BackdropFilter(
        filter: ImageFilter.blur(sigmaX: 8.0, sigmaY: 8.0),
        child: ElevarmDatePickerDialog(
          mode: mode,
          initialDisplayDate: initialDisplayDate,
          initialSelectedDate: initialSelectedDate,
          initialSelectedRange: initialSelectedRange,
          minDate: minDate,
          maxDate: maxDate,
          positiveButtonLabel: positiveButtonLabel,
          negativeButtonLabel: negativeButtonLabel,
          weekNames: weekNames,
        ),
      );
    },
  );
}