CAKE-334 | reworked unspent_coins_list_item.dart

OleksandrSobol committed Jul 23, 2021 at 16:57 UTC a20969b650bba4349c6d8c8b795999cb93f01cc1
16 files changed +61 -15
lib/src/screens/unspent_coins/unspent_coins_list_page.dart
+2 -1
@@ -86,9 +86,10 @@ class UnspentCoinsListFormState extends State<UnspentCoinsListForm> {
86 .pushNamed(Routes.unspentCoinsDetails,
87 arguments: [item, unspentCoinsListViewModel]),
88 child: UnspentCoinsListItem(
89 - address: item.address,
89 + note: item.note,
90 amount: item.amount,
91 isSending: item.isSending,
92 + isFrozen: item.isFrozen,
93 onCheckBoxTap: item.isFrozen
94 ? null
95 : () async {
lib/src/screens/unspent_coins/widgets/unspent_coins_list_item.dart
+45 -14
@@ -2,12 +2,14 @@ import 'package:auto_size_text/auto_size_text.dart';
2 import 'package:cake_wallet/palette.dart';
3 import 'package:flutter/material.dart';
4 import 'package:flutter/cupertino.dart';
5 +import 'package:cake_wallet/generated/i18n.dart';
6
7 class UnspentCoinsListItem extends StatelessWidget {
8 UnspentCoinsListItem({
8 - @required this.address,
9 + @required this.note,
10 @required this.amount,
11 @required this.isSending,
12 + @required this.isFrozen,
13 @required this.onCheckBoxTap,
14 });
15
@@ -16,9 +18,10 @@ class UnspentCoinsListItem extends StatelessWidget {
18 static const selectedItemColor = Palette.paleCornflowerBlue;
19 static const unselectedItemColor = Palette.moderateLavender;
20
19 - final String address;
21 + final String note;
22 final String amount;
23 final bool isSending;
24 + final bool isFrozen;
25 final Function() onCheckBoxTap;
26
27 @override
@@ -51,7 +54,7 @@ class UnspentCoinsListItem extends StatelessWidget {
54 width: 1.0),
55 borderRadius: BorderRadius.all(
56 Radius.circular(8.0)),
54 - color: Theme.of(context).backgroundColor),
57 + color: itemColor),
58 child: isSending
59 ? Icon(
60 Icons.check,
@@ -64,25 +67,53 @@ class UnspentCoinsListItem extends StatelessWidget {
67 ),
68 Expanded(
69 child: Column(
67 - mainAxisAlignment: MainAxisAlignment.spaceBetween,
70 + mainAxisAlignment: (note?.isNotEmpty ?? false)
71 + ? MainAxisAlignment.spaceBetween
72 + : MainAxisAlignment.center,
73 crossAxisAlignment: CrossAxisAlignment.start,
74 children: [
70 - AutoSizeText(
71 - amount,
72 - style: TextStyle(
73 - color: amountColor,
74 - fontSize: 16,
75 - fontWeight: FontWeight.w600
76 - ),
77 - maxLines: 1,
75 + Row(
76 + mainAxisSize: MainAxisSize.max,
77 + mainAxisAlignment: MainAxisAlignment.start,
78 + crossAxisAlignment: CrossAxisAlignment.center,
79 + children: [
80 + Expanded(
81 + child: AutoSizeText(
82 + amount,
83 + style: TextStyle(
84 + color: amountColor,
85 + fontSize: 16,
86 + fontWeight: FontWeight.w600
87 + ),
88 + maxLines: 1,
89 + ),
90 + ),
91 + if (isFrozen) Container(
92 + height: 17,
93 + padding: EdgeInsets.only(left: 6, right: 6),
94 + decoration: BoxDecoration(
95 + borderRadius: BorderRadius.all(Radius.circular(8.5)),
96 + color: Colors.white),
97 + alignment: Alignment.center,
98 + child: Text(
99 + S.of(context).frozen,
100 + style: TextStyle(
101 + color: amountColor,
102 + fontSize: 7,
103 + fontWeight: FontWeight.w600
104 + ),
105 + )
106 + )
107 + ],
108 ),
79 - AutoSizeText(
80 - address,
109 + if (note?.isNotEmpty ?? false) Text(
110 + note,
111 style: TextStyle(
112 color: addressColor,
113 fontSize: 12,
114 ),
115 maxLines: 1,
116 + overflow: TextOverflow.ellipsis
117 )
118 ]
119 )
res/values/strings_de.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Nicht ausgegebene Münzen",
489 "unspent_coins_details_title" : "Details zu nicht ausgegebenen Münzen",
490 "freeze" : "Einfrieren",
491 + "frozen" : "Gefroren",
492 "coin_control" : "Münzkontrolle (optional)",
493
494 "address_detected" : "Adresse erkannt",
res/values/strings_en.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Unspent coins",
489 "unspent_coins_details_title" : "Unspent coins details",
490 "freeze" : "Freeze",
491 + "frozen" : "Frozen",
492 "coin_control" : "Coin control (optional)",
493
494 "address_detected" : "Address detected",
res/values/strings_es.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Monedas no gastadas",
489 "unspent_coins_details_title" : "Detalles de monedas no gastadas",
490 "freeze" : "Congelar",
491 + "frozen" : "Congelada",
492 "coin_control" : "Control de monedas (opcional)",
493
494 "address_detected" : "Dirección detectada",
res/values/strings_hi.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "खर्च न किए गए सिक्के",
489 "unspent_coins_details_title" : "अव्ययित सिक्कों का विवरण",
490 "freeze" : "फ्रीज",
491 + "frozen" : "जमा हुआ",
492 "coin_control" : "सिक्का नियंत्रण (वैकल्पिक)",
493
494 "address_detected" : "पता लग गया",
res/values/strings_hr.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Nepotrošeni novčići",
489 "unspent_coins_details_title" : "Nepotrošeni detalji o novčićima",
490 "freeze" : "Zamrznuti",
491 + "frozen" : "Smrznuto",
492 "coin_control" : "Kontrola novca (nije obavezno)",
493
494 "address_detected" : "Adresa je otkrivena",
res/values/strings_it.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Monete non spese",
489 "unspent_coins_details_title" : "Dettagli sulle monete non spese",
490 "freeze" : "Congelare",
491 + "frozen" : "Congelato",
492 "coin_control" : "Controllo monete (opzionale)",
493
494 "address_detected" : "Indirizzo rilevato",
res/values/strings_ja.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "未使用のコイン",
489 "unspent_coins_details_title" : "未使用のコインの詳細",
490 "freeze" : "氷結",
491 + "frozen" : "凍った",
492 "coin_control" : "コインコントロール(オプション)",
493
494 "address_detected" : "アドレスが検出されました",
res/values/strings_ko.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "사용하지 않은 동전",
489 "unspent_coins_details_title" : "사용하지 않은 동전 세부 정보",
490 "freeze" : "얼다",
491 + "frozen" : "겨울 왕국",
492 "coin_control" : "코인 제어 (옵션)",
493
494 "address_detected" : "주소 감지",
res/values/strings_nl.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Ongebruikte munten",
489 "unspent_coins_details_title" : "Details van niet-uitgegeven munten",
490 "freeze" : "Bevriezen",
491 + "frozen" : "Bevroren",
492 "coin_control" : "Muntcontrole (optioneel)",
493
494 "address_detected" : "Adres gedetecteerd",
res/values/strings_pl.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Niewydane monety",
489 "unspent_coins_details_title" : "Szczegóły niewydanych monet",
490 "freeze" : "Zamrażać",
491 + "frozen" : "Mrożony",
492 "coin_control" : "Kontrola monet (opcjonalnie)",
493
494 "address_detected" : "Wykryto adres",
res/values/strings_pt.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Moedas não gastas",
489 "unspent_coins_details_title" : "Detalhes de moedas não gastas",
490 "freeze" : "Congelar",
491 + "frozen" : "Congeladas",
492 "coin_control" : "Controle de moedas (opcional)",
493
494 "address_detected" : "Endereço detectado",
res/values/strings_ru.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Неизрасходованные монеты",
489 "unspent_coins_details_title" : "Сведения о неизрасходованных монетах",
490 "freeze" : "Заморозить",
491 + "frozen" : "Заморожено",
492 "coin_control" : "Контроль монет (необязательно)",
493
494 "address_detected" : "Обнаружен адрес",
res/values/strings_uk.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "Невитрачені монети",
489 "unspent_coins_details_title" : "Відомості про невитрачені монети",
490 "freeze" : "Заморозити",
491 + "frozen" : "Заморожено",
492 "coin_control" : "Контроль монет (необов’язково)",
493
494 "address_detected" : "Виявлено адресу",
res/values/strings_zh.arb
+1
@@ -488,6 +488,7 @@
488 "unspent_coins_title" : "未使用的硬幣",
489 "unspent_coins_details_title" : "未使用代幣詳情",
490 "freeze" : "凍結",
491 + "frozen" : "凍結的",
492 "coin_control" : "硬幣控制(可選)",
493
494 "address_detected" : "檢測到地址",