From 41d905ca60acf76f7872566e453fd6027f170bf7 Mon Sep 17 00:00:00 2001 From: Lukas Lihotzki Date: Thu, 30 Sep 2021 15:10:18 +0200 Subject: [PATCH] refactor: use more ?. --- lib/encryption/utils/bootstrap.dart | 5 +---- lib/encryption/utils/key_verification.dart | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/encryption/utils/bootstrap.dart b/lib/encryption/utils/bootstrap.dart index 8645d97f..ea33dcf3 100644 --- a/lib/encryption/utils/bootstrap.dart +++ b/lib/encryption/utils/bootstrap.dart @@ -591,10 +591,7 @@ class Bootstrap { _state = newState; } - final onUpdate_ = onUpdate; - if (onUpdate_ != null) { - onUpdate_(); - } + onUpdate?.call(); } } diff --git a/lib/encryption/utils/key_verification.dart b/lib/encryption/utils/key_verification.dart index 8a3dfe12..795675ad 100644 --- a/lib/encryption/utils/key_verification.dart +++ b/lib/encryption/utils/key_verification.dart @@ -620,10 +620,7 @@ class KeyVerification { state = newState; } - final onUpdate = this.onUpdate; - if (onUpdate != null) { - onUpdate(); - } + onUpdate?.call(); } }