copyWith method
Returns a copy with the given fields replaced; omitted fields are kept.
data follows the same data ?? this.data rule as every other field, so
in this first cut (#77) it can be set or changed but not reset to
null; a sentinel can be added later if clearing the payload is needed.
Implementation
PlannerEntry<T> copyWith({
String? id,
PlannerTime? time,
Color? color,
TextStyle? titleStyle,
TextStyle? textStyle,
String? title,
String? content,
T? data,
}) =>
PlannerEntry<T>(
id: id ?? this.id,
time: time ?? this.time,
color: color ?? this.color,
titleStyle: titleStyle ?? this.titleStyle,
textStyle: textStyle ?? this.textStyle,
title: title ?? this.title,
content: content ?? this.content,
data: data ?? this.data,
);