refactor: Use non nullable localizations builder and lazy load on web
This commit is contained in:
parent
8cedd2a45a
commit
0d4b7d67cc
111 changed files with 879 additions and 883 deletions
|
|
@ -35,9 +35,9 @@ extension DateTimeExtension on DateTime {
|
|||
|
||||
/// Returns a simple time String.
|
||||
String localizedTimeOfDay(BuildContext context) =>
|
||||
L10n.of(context)!.alwaysUse24HourFormat == 'true'
|
||||
? DateFormat('HH:mm', L10n.of(context)!.localeName).format(this)
|
||||
: DateFormat('h:mm a', L10n.of(context)!.localeName).format(this);
|
||||
L10n.of(context).alwaysUse24HourFormat == 'true'
|
||||
? DateFormat('HH:mm', L10n.of(context).localeName).format(this)
|
||||
: DateFormat('h:mm a', L10n.of(context).localeName).format(this);
|
||||
|
||||
/// Returns [localizedTimeOfDay()] if the ChatTime is today, the name of the week
|
||||
/// day if the ChatTime is this week and a date string else.
|
||||
|
|
@ -77,7 +77,7 @@ extension DateTimeExtension on DateTime {
|
|||
final sameDay = sameYear && now.month == month && now.day == day;
|
||||
|
||||
if (sameDay) return localizedTimeOfDay(context);
|
||||
return L10n.of(context)!.dateAndTimeOfDay(
|
||||
return L10n.of(context).dateAndTimeOfDay(
|
||||
localizedTimeShort(context),
|
||||
localizedTimeOfDay(context),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue