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

@ -239,8 +239,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
void initLoadingDialog() {
WidgetsBinding.instance.addPostFrameCallback((_) {
LoadingDialog.defaultTitle = L10n.of(context)!.loadingPleaseWait;
LoadingDialog.defaultBackLabel = L10n.of(context)!.close;
LoadingDialog.defaultTitle = L10n.of(context).loadingPleaseWait;
LoadingDialog.defaultBackLabel = L10n.of(context).close;
LoadingDialog.defaultOnError =
(e) => (e as Object?)!.toLocalizedString(context);
});
@ -312,7 +312,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
context,
).showSnackBar(
SnackBar(
content: Text(L10n.of(context)!.oneClientLoggedOut),
content: Text(L10n.of(context).oneClientLoggedOut),
),
);
@ -371,13 +371,12 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
context: FluffyChatApp
.router.routerDelegate.navigatorKey.currentContext ??
context,
title: L10n.of(context)!.pushNotificationsNotAvailable,
title: L10n.of(context).pushNotificationsNotAvailable,
message: errorMsg,
fullyCapitalizedForMaterial: false,
okLabel: link == null
? L10n.of(context)!.ok
: L10n.of(context)!.learnMore,
cancelLabel: L10n.of(context)!.doNotShowAgain,
okLabel:
link == null ? L10n.of(context).ok : L10n.of(context).learnMore,
cancelLabel: L10n.of(context).doNotShowAgain,
);
if (result == OkCancelResult.ok && link != null) {
launchUrlString(
@ -495,8 +494,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
final response = await showOkCancelAlertDialog(
context: context,
isDestructiveAction: true,
title: L10n.of(context)!.dehydrate,
message: L10n.of(context)!.dehydrateWarning,
title: L10n.of(context).dehydrate,
message: L10n.of(context).dehydrateWarning,
);
if (response != OkCancelResult.ok) {
return;