From fcf4fbdc14d2aab9e8c9eda6662dde91c1d3ae7f Mon Sep 17 00:00:00 2001 From: Rafael Saes <76502841+saltrafael@users.noreply.github.com> Date: Tue, 1 Aug 2023 19:19:04 -0300 Subject: [PATCH] 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 --- lib/entities/template.dart | 23 +- lib/src/screens/send/send_page.dart | 69 ++- lib/src/screens/send/send_template_page.dart | 419 ++++++------------ .../send/widgets/send_template_card.dart | 267 +++++++++++ lib/src/widgets/template_tile.dart | 84 ++-- lib/store/templates/send_template_store.dart | 34 +- .../send/send_template_view_model.dart | 104 ++--- lib/view_model/send/template_view_model.dart | 80 ++++ res/values/strings_ar.arb | 3 +- res/values/strings_bg.arb | 3 +- res/values/strings_cs.arb | 3 +- res/values/strings_de.arb | 3 +- res/values/strings_en.arb | 3 +- res/values/strings_es.arb | 3 +- res/values/strings_fr.arb | 3 +- res/values/strings_ha.arb | 3 +- res/values/strings_hi.arb | 3 +- res/values/strings_hr.arb | 3 +- res/values/strings_id.arb | 3 +- res/values/strings_it.arb | 3 +- res/values/strings_ja.arb | 3 +- res/values/strings_ko.arb | 3 +- res/values/strings_my.arb | 3 +- res/values/strings_nl.arb | 3 +- res/values/strings_pl.arb | 3 +- res/values/strings_pt.arb | 3 +- res/values/strings_ru.arb | 3 +- res/values/strings_th.arb | 3 +- res/values/strings_tr.arb | 3 +- res/values/strings_uk.arb | 3 +- res/values/strings_ur.arb | 3 +- res/values/strings_yo.arb | 3 +- res/values/strings_zh.arb | 3 +- 33 files changed, 716 insertions(+), 439 deletions(-) create mode 100644 lib/src/screens/send/widgets/send_template_card.dart create mode 100644 lib/view_model/send/template_view_model.dart diff --git a/lib/entities/template.dart b/lib/entities/template.dart index c26e3a501..8224ecdd8 100644 --- a/lib/entities/template.dart +++ b/lib/entities/template.dart @@ -4,14 +4,15 @@ part 'template.g.dart'; @HiveType(typeId: Template.typeId) class Template extends HiveObject { - Template({ - required this.nameRaw, - required this.isCurrencySelectedRaw, - required this.addressRaw, - required this.cryptoCurrencyRaw, - required this.amountRaw, - required this.fiatCurrencyRaw, - required this.amountFiatRaw}); + Template( + {required this.nameRaw, + required this.isCurrencySelectedRaw, + required this.addressRaw, + required this.cryptoCurrencyRaw, + required this.amountRaw, + required this.fiatCurrencyRaw, + required this.amountFiatRaw, + this.additionalRecipientsRaw}); static const typeId = 6; static const boxName = 'Template'; @@ -37,6 +38,9 @@ class Template extends HiveObject { @HiveField(6) String? amountFiatRaw; + @HiveField(7) + List