fix: Dialogs

This commit is contained in:
Christian Pauly 2021-01-19 15:46:43 +01:00
commit e15a549375
11 changed files with 104 additions and 68 deletions

View file

@ -265,6 +265,7 @@ class _ChatState extends State<Chat> {
context: context,
builder: (context) => RecordingDialog(
onFinished: (r) => result = r,
l10n: L10n.of(context),
));
if (result == null) return;
final audioFile = File(result);

View file

@ -36,7 +36,10 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
setState(() => null);
}
};
await KeyVerificationDialog(request: req).show(context);
await KeyVerificationDialog(
request: req,
l10n: L10n.of(context),
).show(context);
break;
case 'verify_manual':
if (await showOkCancelAlertDialog(
@ -59,7 +62,10 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
setState(() => null);
}
};
await KeyVerificationDialog(request: req).show(context);
await KeyVerificationDialog(
request: req,
l10n: L10n.of(context),
).show(context);
break;
case 'block':
if (key.directVerified) {

View file

@ -20,9 +20,10 @@ class ChatPermissionsSettings extends StatelessWidget {
return FlushbarHelper.createError(message: L10n.of(context).noPermission)
.show(context);
}
final newLevel =
await PermissionSliderDialog(initialPermission: currentLevel)
.show(context);
final newLevel = await PermissionSliderDialog(
initialPermission: currentLevel,
l10n: L10n.of(context),
).show(context);
if (newLevel == null) return;
final content = Map<String, dynamic>.from(
room.getState(EventTypes.RoomPowerLevels).content);

View file

@ -516,7 +516,8 @@ class _SettingsState extends State<Settings> {
: null,
onTap: () async {
if (!client.encryption.crossSigning.enabled) {
return BootstrapDialog().show(context);
return BootstrapDialog(l10n: L10n.of(context))
.show(context);
}
if (client.isUnknownSession) {
final input = await showTextInputDialog(
@ -592,7 +593,8 @@ class _SettingsState extends State<Settings> {
: null,
onTap: () async {
if (!client.encryption.keyManager.enabled) {
return BootstrapDialog().show(context);
return BootstrapDialog(l10n: L10n.of(context))
.show(context);
}
if (!(await client.encryption.keyManager.isCached())) {
await requestSSSSCache(context);