BottomPicker.range constructor
BottomPicker.range({
- Key? key,
- required Widget pickerTitle,
- Widget? pickerDescription,
- required dynamic onRangeDateSubmitPressed()?,
- EdgeInsetsGeometry titlePadding = const EdgeInsets.all(0),
- Alignment? titleAlignment,
- bool dismissable = false,
- Function? onClose,
- BottomPickerTheme bottomPickerTheme = BottomPickerTheme.blue,
- List<
Color> ? gradientColors, - double? buttonPadding,
- double? buttonWidth,
- Color? buttonSingleColor,
- Color backgroundColor = Colors.white,
- TextStyle pickerTextStyle = const TextStyle(fontSize: 14, color: Colors.black),
- bool displayCloseIcon = true,
- @Deprecated('Will be removed, if not null `onClose` will override the close button onTap function') bool popOnClose = true,
- Color closeIconColor = Colors.black,
- double closeIconSize = 20,
- LayoutOrientation layoutOrientation = LayoutOrientation.ltr,
- MainAxisAlignment buttonAlignment = MainAxisAlignment.center,
- double? height,
- DateTime? initialSecondDate,
- DateTime? initialFirstDate,
- DateTime? minFirstDate,
- DateTime? minSecondDate,
- DateTime? maxFirstDate,
- DateTime? maxSecondDate,
- DatePickerDateOrder? dateOrder = DatePickerDateOrder.ymd,
- Widget? buttonContent,
- 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!));
}
}