refactor: Update to Dart 3.10 with . shorthands

This commit is contained in:
Christian Kußowski 2025-11-30 12:54:06 +01:00
commit 1ea649f01e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
167 changed files with 3351 additions and 3912 deletions

View file

@ -42,7 +42,8 @@ extension DateTimeExtension on DateTime {
final sameDay = sameYear && now.month == month && now.day == day;
final sameWeek = sameYear &&
final sameWeek =
sameYear &&
!sameDay &&
now.millisecondsSinceEpoch - millisecondsSinceEpoch <
1000 * 60 * 60 * 24 * 7;
@ -50,14 +51,17 @@ extension DateTimeExtension on DateTime {
if (sameDay) {
return localizedTimeOfDay(context);
} else if (sameWeek) {
return DateFormat.E(Localizations.localeOf(context).languageCode)
.format(this);
return DateFormat.E(
Localizations.localeOf(context).languageCode,
).format(this);
} else if (sameYear) {
return DateFormat.MMMd(Localizations.localeOf(context).languageCode)
.format(this);
return DateFormat.MMMd(
Localizations.localeOf(context).languageCode,
).format(this);
}
return DateFormat.yMMMd(Localizations.localeOf(context).languageCode)
.format(this);
return DateFormat.yMMMd(
Localizations.localeOf(context).languageCode,
).format(this);
}
/// If the DateTime is today, this returns [localizedTimeOfDay()], if not it also