improved performance and battery usage on older devices
This commit is contained in:
@@ -76,10 +76,17 @@ class McTimetableEntry {
|
||||
|
||||
/// Combines the calendar date with the hour/minute portion of [startTime]
|
||||
/// (which carries a 1970 placeholder date) into a real DateTime.
|
||||
DateTime get startDateTime =>
|
||||
DateTime get startDateTime => _startDateTime;
|
||||
|
||||
DateTime get endDateTime => _endDateTime;
|
||||
|
||||
// Cached (private, so json_serializable ignores them): sorting and lesson
|
||||
// merging read these per comparison, and every local DateTime construction
|
||||
// does a timezone lookup.
|
||||
late final DateTime _startDateTime =
|
||||
DateTime(date.year, date.month, date.day, startTime.hour, startTime.minute);
|
||||
|
||||
DateTime get endDateTime =>
|
||||
late final DateTime _endDateTime =
|
||||
DateTime(date.year, date.month, date.day, endTime.hour, endTime.minute);
|
||||
|
||||
static DateTime _dateFromJson(String raw) => DateTime.parse(raw);
|
||||
|
||||
Reference in New Issue
Block a user