BottomPicker.range constructor

BottomPicker.range({
  1. Key? key,
  2. required Widget pickerTitle,
  3. Widget? pickerDescription,
  4. required dynamic onRangeDateSubmitPressed(
    1. DateTime,
    2. DateTime
    )?,
  5. EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0),
  6. Alignment? titleAlignment,
  7. bool dismissable = false,
  8. Function? onClose,
  9. BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue,
  10. List<Color>? gradientColors,
  11. double? buttonPadding,
  12. double? buttonWidth,
  13. Color? buttonSingleColor,
  14. Color backgroundColor = Colors.white,
  15. TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black),
  16. bool displayCloseIcon = true,
  17. @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true,
  18. Color closeIconColor = Colors.black,
  19. double closeIconSize = 20,
  20. LayoutOrientation layoutOrientation = LayoutOrientation.ltr,
  21. MainAxisAlignment buttonAlignment = MainAxisAlignment.center,
  22. double? height,
  23. DateTime? initialSecondDate,
  24. DateTime? initialFirstDate,
  25. DateTime? minFirstDate,
  26. DateTime? minSecondDate,
  27. DateTime? maxFirstDate,
  28. DateTime? maxSecondDate,
  29. DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd,
  30. Widget? buttonContent,
  31. BoxDecoration? buttonStyle,
})

Implementation

BottomPicker.range({
  Key? key,
  required this.pickerTitle,
  this.pickerDescription,
  required this.onRangeDateSubmitPressed,
  this.titlePadding = const EdgeInsets.all(0),
  this.titleAlignment,
  this.dismissable = false,
  this.onClose,
  this.bottomPickerTheme = BottomPickerTheme.blue,
  this.gradientColors,
  this.buttonPadding,
  this.buttonWidth,
  this.buttonSingleColor,
  this.backgroundColor = Colors.white,
  this.pickerTextStyle = const TextStyle(
    fontSize: 14,
    color: Colors.black,
  ),
  this.displayCloseIcon = true,
  @Deprecated(
    'Will be removed, if not null `onClose` will override the close button onTap function',
  )
  this.popOnClose = true,
  this.closeIconColor = Colors.black,
  this.closeIconSize = 20,
  this.layoutOrientation = LayoutOrientation.ltr,
  this.buttonAlignment = MainAxisAlignment.center,
  this.height,
  this.initialSecondDate,
  this.initialFirstDate,
  this.minFirstDate,
  this.minSecondDate,
  this.maxFirstDate,
  this.maxSecondDate,
  this.dateOrder = DatePickerDateOrder.ymd,
  this.buttonContent,
  this.buttonStyle,
}) : super(key: key) {
  datePickerMode = CupertinoDatePickerMode.date;
  bottomPickerType = BottomPickerType.rangeDateTime;
  dateOrder = null;
  itemExtent = 0;
  onChange = null;
  onSubmit = null;
  displaySubmitButton = true;
  assert(onRangeDateSubmitPressed != null);
  assertInitialValues();
  if (minSecondDate != null && initialSecondDate != null) {
    assert(initialSecondDate!.isAfter(minSecondDate!));
  }
  if (minFirstDate != null && initialFirstDate != null) {
    assert(initialFirstDate!.isAfter(minFirstDate!));
  }
}