Show wallet name for default/MyStack contact addresses on popup

This commit is contained in:
julian 2022-09-14 10:38:49 -06:00
parent 73ae1c7c90
commit f61621896c
3 changed files with 17 additions and 0 deletions

View file

@ -6,22 +6,26 @@ class ContactAddressEntry {
final Coin coin;
final String address;
final String label;
final String? other;
const ContactAddressEntry({
required this.coin,
required this.address,
required this.label,
this.other,
});
ContactAddressEntry copyWith({
Coin? coin,
String? address,
String? label,
String? other,
}) {
return ContactAddressEntry(
coin: coin ?? this.coin,
address: address ?? this.address,
label: label ?? this.label,
other: other ?? this.other,
);
}
@ -30,6 +34,7 @@ class ContactAddressEntry {
coin: Coin.values.byName(jsonObject["coin"] as String),
address: jsonObject["address"] as String,
label: jsonObject["label"] as String,
other: jsonObject["other"] as String?,
);
}
@ -38,6 +43,7 @@ class ContactAddressEntry {
"label": label,
"address": address,
"coin": coin.name,
"other": other ?? "",
};
}

View file

@ -73,6 +73,7 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
coin: manager.coin,
address: await manager.currentReceivingAddress,
label: "Current Receiving",
other: manager.walletName,
),
);
}

View file

@ -208,6 +208,16 @@ class ContactPopUp extends ConsumerWidget {
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (contact.id == "default")
Text(
e.other!,
style:
STextStyles.itemSubtitle12,
),
if (contact.id == "default")
const SizedBox(
height: 2,
),
Text(
"${e.label} (${e.coin.ticker})",
style: STextStyles.itemSubtitle12,