Task constructor
Creates a new task with the given id, title, and subtitle.
Throws TaskOperationException if:
titleis longer than 100 characterssubtitleis longer than 100 characters
Implementation
Task({required this.id, required this.title, required this.subtitle}) {
if (title.length > 100) {
throw TaskOperationException('Title must be at most 100 characters long.');
}
if (subtitle.length > 100) {
throw TaskOperationException('Subtitle must be at most 100 characters long.');
}
}