refactor: Update to Dart 3.10 with . shorthands
This commit is contained in:
parent
75a37f3f7c
commit
1ea649f01e
167 changed files with 3351 additions and 3912 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue