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

@ -93,12 +93,12 @@ class SendLocationDialogState extends State<SendLocationDialog> {
longitude: position!.longitude,
);
} else if (disabled) {
contentWidget = Text(L10n.of(context)!.locationDisabledNotice);
contentWidget = Text(L10n.of(context).locationDisabledNotice);
} else if (denied) {
contentWidget = Text(L10n.of(context)!.locationPermissionDeniedNotice);
contentWidget = Text(L10n.of(context).locationPermissionDeniedNotice);
} else if (error != null) {
contentWidget =
Text(L10n.of(context)!.errorObtainingLocation(error.toString()));
Text(L10n.of(context).errorObtainingLocation(error.toString()));
} else {
contentWidget = Row(
mainAxisSize: MainAxisSize.min,
@ -106,22 +106,22 @@ class SendLocationDialogState extends State<SendLocationDialog> {
children: [
const CupertinoActivityIndicator(),
const SizedBox(width: 12),
Text(L10n.of(context)!.obtainingLocation),
Text(L10n.of(context).obtainingLocation),
],
);
}
return AlertDialog.adaptive(
title: Text(L10n.of(context)!.shareLocation),
title: Text(L10n.of(context).shareLocation),
content: contentWidget,
actions: [
TextButton(
onPressed: Navigator.of(context, rootNavigator: false).pop,
child: Text(L10n.of(context)!.cancel),
child: Text(L10n.of(context).cancel),
),
if (position != null)
TextButton(
onPressed: isSending ? null : sendAction,
child: Text(L10n.of(context)!.send),
child: Text(L10n.of(context).send),
),
],
);