mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 08:15:09 +00:00
fix: Add cancel button to key request dialog
This commit is contained in:
parent
708629acca
commit
40003628b9
1 changed files with 10 additions and 1 deletions
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue