EasyInfiniteDateTimeLine constructor
const
EasyInfiniteDateTimeLine({
- Key? key,
- List<
DateTime> ? disabledDates, - EasyTimeLineProps timeLineProps = const EasyTimeLineProps(),
- EasyDayProps dayProps = const EasyDayProps(),
- OnDateChangeCallBack? onDateChange,
- ItemBuilderCallBack? itemBuilder,
- Color? activeColor,
- String locale = "en_US",
- EasyInfiniteDateTimelineController? controller,
- bool showTimelineHeader = true,
- HeaderBuilderCallBack? headerBuilder,
- SelectionMode selectionMode = const SelectionMode.autoCenter(),
- ScrollPhysics? physics,
- required DateTime firstDate,
- required DateTime? focusDate,
- 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
: AString
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,
});