refactor: Enable lint use_build_context_synchronously

This commit is contained in:
Christian Kußowski 2026-03-25 10:42:17 +01:00
commit 3296c0d92d
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
50 changed files with 490 additions and 293 deletions

View file

@ -82,6 +82,7 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
},
);
if (valid.error != null) {
if (!mounted) return;
await showOkAlertDialog(
useRootNavigator: false,
context: context,
@ -178,9 +179,10 @@ class KeyVerificationPageState extends State<KeyVerificationDialog> {
);
buttons.add(
AdaptiveDialogAction(
onPressed: () => widget.request.rejectVerification().then(
(_) => Navigator.of(context, rootNavigator: false).pop(false),
),
onPressed: () => widget.request.rejectVerification().then((_) {
if (!context.mounted) return;
Navigator.of(context, rootNavigator: false).pop(false);
}),
child: Text(
L10n.of(context).reject,
style: TextStyle(color: theme.colorScheme.error),