Timeline constructor
const
Timeline({
- Key? key,
- required List<
TimelineData> data, - BoxConstraints? timeConstraints,
Creates a Timeline widget with the specified data entries.
Parameters:
data
(ListtimeConstraints
(BoxConstraints?, optional): Override width constraints for time column.
The timeline automatically handles layout, styling, and visual indicators based on the current theme and provided data. Each entry's time, title, content, and color are used to construct the appropriate visual representation.
Example:
Timeline(
timeConstraints: BoxConstraints(minWidth: 80, maxWidth: 120),
data: [
TimelineData(
time: Text('Yesterday'),
title: Text('Initial Setup'),
content: Text('Project repository created and initial structure added.'),
),
TimelineData(
time: Text('Today'),
title: Text('Feature Development'),
content: Text('Implementing core functionality and UI components.'),
color: Colors.orange,
),
],
);
Implementation
const Timeline({
super.key,
required this.data,
// this.timeConstraints = const BoxConstraints(
// minWidth: 120,
// maxWidth: 120,
// ),
this.timeConstraints,
});