toDateTime method
Converts a TimeOfDay to a DateTime.
date - The date to use for the DateTime. Defaults to today if null.
Implementation
DateTime toDateTime({DateTime? date, bool isUtc = true}) {
final baseDate = date ?? (isUtc ? DateTime.now().toUtc() : DateTime.now());
return DateTime(
baseDate.year,
baseDate.month,
baseDate.day,
hour,
minute,
);
}