copyWith method
Creates a copy of this task with optionally updated fields.
The id is preserved while title and subtitle can be updated.
Implementation
Task copyWith({ String? title, String? subtitle}) {
return Task(
id: id,
title: title ?? this.title,
subtitle: subtitle ?? this.subtitle,
);
}