From 79704da99c77748a2c1bd4520c516b793cbaa086 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Wed, 14 Sep 2022 22:02:50 +0200 Subject: [PATCH] fix: Fix issues with the maps being unmodifiable --- lib/src/trust/btbv.dart | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/src/trust/btbv.dart b/lib/src/trust/btbv.dart index aa7ac03..2b7cf32 100644 --- a/lib/src/trust/btbv.dart +++ b/lib/src/trust/btbv.dart @@ -34,10 +34,13 @@ BTBVTrustState _trustFromInt(int i) { /// See https://gultsch.de/trust.html for more details. abstract class BlindTrustBeforeVerificationTrustManager extends TrustManager { BlindTrustBeforeVerificationTrustManager({ - this.trustCache = const {}, - this.enablementCache = const {}, - this.devices = const {}, - }) : _lock = Lock(); + Map? trustCache, + Map? enablementCache, + Map>? devices, + }) : trustCache = trustCache ?? {}, + enablementCache = enablementCache ?? {}, + devices = devices ?? {}, + _lock = Lock(); /// The cache for mapping a RatchetMapKey to its trust state @visibleForTesting