refactor: Use non nullable localizations builder and lazy load on web

This commit is contained in:
krille-chan 2024-10-06 08:35:37 +02:00
commit 0d4b7d67cc
No known key found for this signature in database
111 changed files with 879 additions and 883 deletions

View file

@ -32,13 +32,13 @@ class PinnedEvents extends StatelessWidget {
? events.single?.eventId
: await showConfirmationDialog<String>(
context: context,
title: L10n.of(context)!.pinMessage,
title: L10n.of(context).pinMessage,
actions: events
.map(
(event) => AlertDialogAction(
key: event?.eventId ?? '',
label: event?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: true,
hideReply: true,
) ??
@ -67,17 +67,17 @@ class PinnedEvents extends StatelessWidget {
final event = snapshot.data;
return ChatAppBarListTile(
title: event?.calcLocalizedBodyFallback(
MatrixLocals(L10n.of(context)!),
MatrixLocals(L10n.of(context)),
withSenderNamePrefix: true,
hideReply: true,
) ??
L10n.of(context)!.loadingPleaseWait,
L10n.of(context).loadingPleaseWait,
leading: IconButton(
splashRadius: 18,
iconSize: 18,
color: theme.colorScheme.onSurfaceVariant,
icon: const Icon(Icons.push_pin),
tooltip: L10n.of(context)!.unpin,
tooltip: L10n.of(context).unpin,
onPressed: controller.room.canSendEvent(EventTypes.RoomPinnedEvents)
? () => controller.unpinEvent(event!.eventId)
: null,