EasyInfiniteDateTimeLine constructor

const EasyInfiniteDateTimeLine({
  1. Key? key,
  2. List<DateTime>? disabledDates,
  3. EasyTimeLineProps timeLineProps = const EasyTimeLineProps(),
  4. EasyDayProps dayProps = const EasyDayProps(),
  5. OnDateChangeCallBack? onDateChange,
  6. ItemBuilderCallBack? itemBuilder,
  7. Color? activeColor,
  8. String locale = "en_US",
  9. EasyInfiniteDateTimelineController? controller,
  10. bool showTimelineHeader = true,
  11. HeaderBuilderCallBack? headerBuilder,
  12. SelectionMode selectionMode = const SelectionMode.autoCenter(),
  13. ScrollPhysics? physics,
  14. required DateTime firstDate,
  15. required DateTime? focusDate,
  16. required DateTime lastDate,
})

A widget that displays an infinite date timeline.

The timeline widget allows users to scroll through a range of dates and select a specific date. It provides a visual representation of the dates, with each day displayed as a separate widget. The timeline can be customized with various properties to control its appearance and behavior.

The EasyInfiniteDateTimeLine widget requires the following parameters:

  • firstDate: Represents the initial date for the timeline widget.
  • focusDate: Represents the focus date for the timeline widget.
  • lastDate: Represents the last date for the timeline widget.

Optional parameters include:

  • disabledDates: Represents a list of inactive dates for the timeline widget.
  • activeColor: The color for the active day.
  • timeLineProps: Contains properties for configuring the appearance and behavior of the timeline widget.
  • dayProps: Contains properties for configuring the appearance and behavior of the day widgets in the timeline.
  • onDateChange: Called when the selected date in the timeline changes.
  • itemBuilder: A callback function that builds the custom day widgets for the timeline.
  • locale: A String that represents the locale code to use for formatting the dates in the timeline.
  • controller: The controller to manage the EasyInfiniteDateTimeline.
  • showTimelineHeader: Represents whether the timeline header should be displayed or not.
  • headerBuilder: The callback function used to build the header of the infinite date timeline.
  • autoCenter: Automatically centers the selected day in the timeline.

Example usage:

EasyInfiniteDateTimeLine(
  firstDate: DateTime(2022, 1, 1),
  focusDate: DateTime(2022, 1, 15),
  lastDate: DateTime(2022, 12, 31),
  disabledDates: [DateTime(2022, 1, 10), DateTime(2022, 1, 20)],
  activeColor: Colors.blue,
  timeLineProps: EasyTimeLineProps(),
  dayProps: EasyDayProps(),
  onDateChange: (DateTime selectedDate) {
    // Handle selected date change
  },
  locale: "en_US",
  controller: EasyInfiniteDateTimelineController(),
  showTimelineHeader: true,
)

Implementation

const EasyInfiniteDateTimeLine({
  super.key,
  this.disabledDates,
  this.timeLineProps = const EasyTimeLineProps(),
  this.dayProps = const EasyDayProps(),
  this.onDateChange,
  this.itemBuilder,
  this.activeColor,
  this.locale = "en_US",
  this.controller,
  this.showTimelineHeader = true,
  this.headerBuilder,
  this.selectionMode = const SelectionMode.autoCenter(),
  this.physics,
  required this.firstDate,
  required this.focusDate,
  required this.lastDate,
});