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
|
|
@ -34,33 +34,33 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
|
|||
if (room.encrypted) {
|
||||
showOkAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.sorryThatsNotPossible,
|
||||
message: L10n.of(context)!.disableEncryptionWarning,
|
||||
title: L10n.of(context).sorryThatsNotPossible,
|
||||
message: L10n.of(context).disableEncryptionWarning,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (room.joinRules == JoinRules.public) {
|
||||
showOkAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.sorryThatsNotPossible,
|
||||
message: L10n.of(context)!.noEncryptionForPublicRooms,
|
||||
title: L10n.of(context).sorryThatsNotPossible,
|
||||
message: L10n.of(context).noEncryptionForPublicRooms,
|
||||
);
|
||||
return;
|
||||
}
|
||||
if (!room.canChangeStateEvent(EventTypes.Encryption)) {
|
||||
showOkAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.sorryThatsNotPossible,
|
||||
message: L10n.of(context)!.noPermission,
|
||||
title: L10n.of(context).sorryThatsNotPossible,
|
||||
message: L10n.of(context).noPermission,
|
||||
);
|
||||
return;
|
||||
}
|
||||
final consent = await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.areYouSure,
|
||||
message: L10n.of(context)!.enableEncryptionWarning,
|
||||
okLabel: L10n.of(context)!.yes,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
title: L10n.of(context).areYouSure,
|
||||
message: L10n.of(context).enableEncryptionWarning,
|
||||
okLabel: L10n.of(context).yes,
|
||||
cancelLabel: L10n.of(context).cancel,
|
||||
);
|
||||
if (consent != OkCancelResult.ok) return;
|
||||
await showFutureLoadingDialog(
|
||||
|
|
@ -72,10 +72,10 @@ class ChatEncryptionSettingsController extends State<ChatEncryptionSettings> {
|
|||
void startVerification() async {
|
||||
final consent = await showOkCancelAlertDialog(
|
||||
context: context,
|
||||
title: L10n.of(context)!.verifyOtherUser,
|
||||
message: L10n.of(context)!.verifyOtherUserDescription,
|
||||
okLabel: L10n.of(context)!.ok,
|
||||
cancelLabel: L10n.of(context)!.cancel,
|
||||
title: L10n.of(context).verifyOtherUser,
|
||||
message: L10n.of(context).verifyOtherUserDescription,
|
||||
okLabel: L10n.of(context).ok,
|
||||
cancelLabel: L10n.of(context).cancel,
|
||||
fullyCapitalizedForMaterial: false,
|
||||
);
|
||||
if (consent != OkCancelResult.ok) return;
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
icon: const Icon(Icons.close_outlined),
|
||||
onPressed: () => context.go('/rooms/${controller.roomId!}'),
|
||||
),
|
||||
title: Text(L10n.of(context)!.encryption),
|
||||
title: Text(L10n.of(context).encryption),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => launchUrlString(AppConfig.encryptionTutorial),
|
||||
child: Text(L10n.of(context)!.help),
|
||||
child: Text(L10n.of(context).help),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -49,7 +49,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
backgroundColor: theme.colorScheme.primaryContainer,
|
||||
child: const Icon(Icons.lock_outlined),
|
||||
),
|
||||
title: Text(L10n.of(context)!.encryptThisChat),
|
||||
title: Text(L10n.of(context).encryptThisChat),
|
||||
value: room.encrypted,
|
||||
onChanged: controller.enableEncryption,
|
||||
),
|
||||
|
|
@ -67,7 +67,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
child: ElevatedButton.icon(
|
||||
onPressed: controller.startVerification,
|
||||
icon: const Icon(Icons.verified_outlined),
|
||||
label: Text(L10n.of(context)!.verifyStart),
|
||||
label: Text(L10n.of(context).verifyStart),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -75,7 +75,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
const SizedBox(height: 16),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.deviceKeys,
|
||||
L10n.of(context).deviceKeys,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
|
|
@ -91,7 +91,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
if (snapshot.hasError) {
|
||||
return Center(
|
||||
child: Text(
|
||||
'${L10n.of(context)!.oopsSomethingWentWrong}: ${snapshot.error}',
|
||||
'${L10n.of(context).oopsSomethingWentWrong}: ${snapshot.error}',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
@ -133,7 +133,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
const SizedBox(width: 4),
|
||||
Text(
|
||||
deviceKeys[i].deviceId ??
|
||||
L10n.of(context)!.unknownDevice,
|
||||
L10n.of(context).unknownDevice,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Flexible(
|
||||
|
|
@ -167,7 +167,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
),
|
||||
subtitle: Text(
|
||||
deviceKeys[i].ed25519Key?.beautified ??
|
||||
L10n.of(context)!.unknownEncryptionAlgorithm,
|
||||
L10n.of(context).unknownEncryptionAlgorithm,
|
||||
style: TextStyle(
|
||||
fontFamily: 'RobotoMono',
|
||||
color: theme.colorScheme.secondary,
|
||||
|
|
@ -183,7 +183,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|||
padding: const EdgeInsets.all(16.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
L10n.of(context)!.encryptionNotEnabled,
|
||||
L10n.of(context).encryptionNotEnabled,
|
||||
style: const TextStyle(
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue