GanttTask constructor
GanttTask({})
Implementation
GanttTask({
required this.id,
required this.name,
required this.start,
required this.end,
required this.status,
required this.color,
required this.details,
this.progress,
this.dependsOn,
}) {
// Ensure start is before end
if (start.isAfter(end)) {
final temp = start;
start = end;
end = temp;
}
// Ensure progress is within valid range
if (progress != null) {
if (progress! < 0.0) {
progress = 0.0;
} else if (progress! > 1.0) {
progress = 1.0;
}
}
}