FlutterDatePickerTimeline constructor

FlutterDatePickerTimeline({
  1. Key? key,
  2. CalendarMode calendarMode = CalendarMode.gregorian,
  3. required DateTime startDate,
  4. required DateTime endDate,
  5. DateTime? initialSelectedDate,
  6. DateTime? initialFocusedDate,
  7. TextDirection? textDirection,
  8. double selectedItemWidth = 170,
  9. double unselectedItemWidth = 38,
  10. double itemHeight = 38,
  11. double itemRadius = 10,
  12. EdgeInsets listViewPadding = const EdgeInsets.only(right: 5.5, left: 5.5),
  13. EdgeInsets selectedItemMargin = const EdgeInsets.only(right: 5.5, left: 5.5),
  14. EdgeInsets unselectedItemMargin = const EdgeInsets.only(right: 5.5, left: 5.5),
  15. Color selectedItemBackgroundColor = const Color(0xFF2B2C30),
  16. Color unselectedItemBackgroundColor = Colors.white,
  17. TextStyle? selectedItemTextStyle,
  18. TextStyle? unselectedItemTextStyle,
  19. required DateChangeListener onSelectedDateChange,
})

Implementation

FlutterDatePickerTimeline({
  Key? key,
  this.calendarMode = CalendarMode.gregorian,
  required this.startDate,
  required this.endDate,
  this.initialSelectedDate,
  this.initialFocusedDate,
  this.textDirection,
  this.selectedItemWidth = 170,
  this.unselectedItemWidth = 38,
  this.itemHeight = 38,
  this.itemRadius = 10,
  this.listViewPadding = const EdgeInsets.only(right: 5.5, left: 5.5),
  this.selectedItemMargin = const EdgeInsets.only(right: 5.5, left: 5.5),
  this.unselectedItemMargin = const EdgeInsets.only(right: 5.5, left: 5.5),
  this.selectedItemBackgroundColor = const Color(0xFF2B2C30),
  this.unselectedItemBackgroundColor = Colors.white,
  this.selectedItemTextStyle,
  this.unselectedItemTextStyle,
  required this.onSelectedDateChange,
})  : assert((endDate.isSameDate(startDate) || endDate.isAfter(startDate)),
          "The end date must be same or before the start date!"),
      assert(
          initialSelectedDate == null ||
              initialSelectedDate.isInRange(startDate, endDate),
          "The initialSelectedDate must be in the start and end date range!"),
      assert(
          initialFocusedDate == null ||
              initialFocusedDate.isInRange(startDate, endDate),
          "The initialFocusedDate must be in the start and end date range!"),
      super(key: key);