mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Cw 433 support send templates with multiple recipients (#995)
* feat: Support Send templates with multiple recipients * feat: use only first name for template display, and sum total amount * fix: amounts being wiped * feat: make send template card buttons function like send card * feat: replace amount -> name for template name * fix: template name
This commit is contained in:
@@ -23,25 +23,27 @@ abstract class SendTemplateBase with Store {
|
||||
templates.replaceRange(0, templates.length, templateSource.values.toList());
|
||||
|
||||
@action
|
||||
Future<void> addTemplate({
|
||||
required String name,
|
||||
required bool isCurrencySelected,
|
||||
required String address,
|
||||
required String cryptoCurrency,
|
||||
required String fiatCurrency,
|
||||
required String amount,
|
||||
required String amountFiat}) async {
|
||||
Future<void> addTemplate(
|
||||
{required String name,
|
||||
required bool isCurrencySelected,
|
||||
required String address,
|
||||
required String cryptoCurrency,
|
||||
required String fiatCurrency,
|
||||
required String amount,
|
||||
required String amountFiat,
|
||||
required List<Template> additionalRecipients}) async {
|
||||
final template = Template(
|
||||
nameRaw: name,
|
||||
isCurrencySelectedRaw: isCurrencySelected,
|
||||
addressRaw: address,
|
||||
cryptoCurrencyRaw: cryptoCurrency,
|
||||
fiatCurrencyRaw: fiatCurrency,
|
||||
amountRaw: amount,
|
||||
amountFiatRaw: amountFiat);
|
||||
nameRaw: name,
|
||||
isCurrencySelectedRaw: isCurrencySelected,
|
||||
addressRaw: address,
|
||||
cryptoCurrencyRaw: cryptoCurrency,
|
||||
fiatCurrencyRaw: fiatCurrency,
|
||||
amountRaw: amount,
|
||||
amountFiatRaw: amountFiat,
|
||||
additionalRecipientsRaw: additionalRecipients);
|
||||
await templateSource.add(template);
|
||||
}
|
||||
|
||||
@action
|
||||
Future<void> remove({required Template template}) async => await template.delete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user