fix: Add cancel button to key request dialog

This commit is contained in:
Krille 2024-01-16 08:35:50 +01:00
parent 708629acca
commit 40003628b9
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652

View file

@ -228,6 +228,13 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
], ],
), ),
); );
buttons.add(
TextButton.icon(
icon: const Icon(Icons.close),
label: Text(L10n.of(context)!.cancel),
onPressed: () => widget.request.cancel(),
),
);
break; break;
case KeyVerificationState.askSas: case KeyVerificationState.askSas:
@ -322,11 +329,13 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
); );
break; break;
case KeyVerificationState.error: case KeyVerificationState.error:
title = const Text('');
body = Column( body = Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
const Icon(Icons.cancel, color: Colors.red, size: 128.0), const Icon(Icons.cancel, color: Colors.red, size: 128.0),
const SizedBox(height: 10), const SizedBox(height: 16),
// TODO: Add better error UI to user
Text( Text(
'Error ${widget.request.canceledCode}: ${widget.request.canceledReason}', 'Error ${widget.request.canceledCode}: ${widget.request.canceledReason}',
textAlign: TextAlign.center, textAlign: TextAlign.center,