37 Widget
build(BuildContext context) {
39 decoration: BoxDecoration(
40 gradient: LinearGradient(
41 begin: Alignment.topCenter,
42 end: Alignment.center,
44 Theme.of(context).colorScheme.surface.withOpacity(0.5),
45 Theme.of(context).scaffoldBackgroundColor,
54 mainAxisSize: MainAxisSize.min,
58 headerStyle: DateRangePickerHeaderStyle(
60 textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
61 color: Theme.of(context).colorScheme.primary,
64 monthCellStyle: DateRangePickerMonthCellStyle(
65 textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
69 selectionTextStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
70 color: Theme.of(context).colorScheme.onPrimary,
72 fontWeight: FontWeight.bold,
74 monthViewSettings: DateRangePickerMonthViewSettings(
75 viewHeaderStyle: DateRangePickerViewHeaderStyle(
76 textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
80 weekNumberStyle: DateRangePickerWeekNumberStyle(
81 textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(),
84 todayHighlightColor: Theme.of(context).colorScheme.primary,
85 showTodayButton:
false,
87 initialDisplayDate: widget.startDate,
88 selectionMode: DateRangePickerSelectionMode.range,
89 initialSelectedRange: PickerDateRange(
94 SizedBox(height: 15.sp),
98 widget.selectedDates(startDate, endDate);
107 showWarningSnackBar(String
message) {
108 CustomSnackBar.display(
110 Theme.of(context).hintColor,
119 .translate(
'Start date cannot be greater than end date'),
127 .translate(
'Start date cannot be greater than end date'),
135 if (differenceInMonths > 2) {
138 .translate(
'Please select a duration less than 3 months'),
145 .translate(
'Please select both start and end date'),