DynamicTimeline constructor
DynamicTimeline({
- Key? key,
- required DateTime firstDateTime,
- required DateTime lastDateTime,
- required String? labelBuilder(),
- Axis axis = Axis.vertical,
- Duration? intervalDuration,
- double intervalExtent = 100,
- int crossAxisCount = 1,
- double maxCrossAxisIndicatorExtent = 60,
- double? maxCrossAxisItemExtent,
- Duration? minItemDuration,
- double crossAxisSpacing = 20,
- Color color = Colors.black,
- double strokeWidth = 2,
- StrokeCap strokeCap = StrokeCap.round,
- bool resizable = true,
- Paint? paint,
- TextStyle? textStyle,
- required List<
TimelineItem> items,
A widget that displays a timeline and positions its children using their start and end date times.
Each child must be a TimelineItem that represents an event.
Each item must have a key in case of displaying dynamic data.
This widget has a fixed size, calculated using the extent properties.
Implementation
DynamicTimeline({
Key? key,
required this.firstDateTime,
required this.lastDateTime,
required this.labelBuilder,
this.axis = Axis.vertical,
this.intervalDuration,
this.intervalExtent = 100,
this.crossAxisCount = 1,
this.maxCrossAxisIndicatorExtent = 60,
this.maxCrossAxisItemExtent,
this.minItemDuration,
this.crossAxisSpacing = 20,
this.color = Colors.black,
this.strokeWidth = 2,
this.strokeCap = StrokeCap.round,
this.resizable = true,
this.paint,
this.textStyle,
required List<TimelineItem> items,
}) : assert(
maxCrossAxisItemExtent != double.infinity,
"max cross axis item extent can't be infinite. ",
),
assert(
firstDateTime.isBefore(lastDateTime),
'firstDateTime must be before lastDateTime: '
'firstDateTime: $firstDateTime --- lastDateTime: $lastDateTime',
),
super(key: key, children: items);