From cdbbb0a3df295013140ee45605af777dc9cb4d6e Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 7 Aug 2023 12:53:18 -0600 Subject: [PATCH] add copyWith to Address --- .../isar/models/blockchain_data/address.dart | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/models/isar/models/blockchain_data/address.dart b/lib/models/isar/models/blockchain_data/address.dart index 17576fbec..3200058b1 100644 --- a/lib/models/isar/models/blockchain_data/address.dart +++ b/lib/models/isar/models/blockchain_data/address.dart @@ -71,6 +71,29 @@ class Address extends CryptoCurrencyAddress { subType == AddressSubType.paynymSend || subType == AddressSubType.paynymReceive; + Address copyWith({ + String? walletId, + String? value, + List? publicKey, + int? derivationIndex, + AddressType? type, + AddressSubType? subType, + DerivationPath? derivationPath, + String? otherData, + }) { + return Address( + walletId: walletId ?? this.walletId, + value: value ?? this.value, + publicKey: publicKey ?? this.publicKey, + derivationIndex: derivationIndex ?? this.derivationIndex, + type: type ?? this.type, + subType: subType ?? this.subType, + derivationPath: derivationPath ?? this.derivationPath, + otherData: otherData ?? this.otherData, + ); + } + + @override String toString() => "{ " "id: $id, "