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

@ -22,12 +22,12 @@ class Settings3PidController extends State<Settings3Pid> {
final input = await showTextInputDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.enterAnEmailAddress,
okLabel: L10n.of(context)!.ok,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).enterAnEmailAddress,
okLabel: L10n.of(context).ok,
cancelLabel: L10n.of(context).cancel,
textFields: [
DialogTextField(
hintText: L10n.of(context)!.enterAnEmailAddress,
hintText: L10n.of(context).enterAnEmailAddress,
keyboardType: TextInputType.emailAddress,
),
],
@ -46,9 +46,9 @@ class Settings3PidController extends State<Settings3Pid> {
final ok = await showOkAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.weSentYouAnEmail,
message: L10n.of(context)!.pleaseClickOnLink,
okLabel: L10n.of(context)!.iHaveClickedOnLink,
title: L10n.of(context).weSentYouAnEmail,
message: L10n.of(context).pleaseClickOnLink,
okLabel: L10n.of(context).iHaveClickedOnLink,
);
if (ok != OkCancelResult.ok) return;
final success = await showFutureLoadingDialog(
@ -71,9 +71,9 @@ class Settings3PidController extends State<Settings3Pid> {
if (await showOkCancelAlertDialog(
useRootNavigator: false,
context: context,
title: L10n.of(context)!.areYouSure,
okLabel: L10n.of(context)!.yes,
cancelLabel: L10n.of(context)!.cancel,
title: L10n.of(context).areYouSure,
okLabel: L10n.of(context).yes,
cancelLabel: L10n.of(context).cancel,
) !=
OkCancelResult.ok) {
return;

View file

@ -20,12 +20,12 @@ class Settings3PidView extends StatelessWidget {
return Scaffold(
appBar: AppBar(
leading: const Center(child: BackButton()),
title: Text(L10n.of(context)!.passwordRecovery),
title: Text(L10n.of(context).passwordRecovery),
actions: [
IconButton(
icon: const Icon(Icons.add_outlined),
onPressed: controller.add3PidAction,
tooltip: L10n.of(context)!.addEmail,
tooltip: L10n.of(context).addEmail,
),
],
),
@ -66,8 +66,8 @@ class Settings3PidView extends StatelessWidget {
),
title: Text(
identifier.isEmpty
? L10n.of(context)!.noPasswordRecoveryDescription
: L10n.of(context)!
? L10n.of(context).noPasswordRecoveryDescription
: L10n.of(context)
.withTheseAddressesRecoveryDescription,
),
),
@ -83,7 +83,7 @@ class Settings3PidView extends StatelessWidget {
),
title: Text(identifier[i].address),
trailing: IconButton(
tooltip: L10n.of(context)!.delete,
tooltip: L10n.of(context).delete,
icon: const Icon(Icons.delete_forever_outlined),
color: Colors.red,
onPressed: () => controller.delete3Pid(identifier[i]),