CAKE-334 | reworked unspent_coins_list_item.dart

This commit is contained in:
OleksandrSobol 2021-07-23 16:57:49 +03:00
parent 800376b6b2
commit a20969b650
16 changed files with 61 additions and 15 deletions

View file

@ -86,9 +86,10 @@ class UnspentCoinsListFormState extends State<UnspentCoinsListForm> {
.pushNamed(Routes.unspentCoinsDetails,
arguments: [item, unspentCoinsListViewModel]),
child: UnspentCoinsListItem(
address: item.address,
note: item.note,
amount: item.amount,
isSending: item.isSending,
isFrozen: item.isFrozen,
onCheckBoxTap: item.isFrozen
? null
: () async {

View file

@ -2,12 +2,14 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/palette.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:cake_wallet/generated/i18n.dart';
class UnspentCoinsListItem extends StatelessWidget {
UnspentCoinsListItem({
@required this.address,
@required this.note,
@required this.amount,
@required this.isSending,
@required this.isFrozen,
@required this.onCheckBoxTap,
});
@ -16,9 +18,10 @@ class UnspentCoinsListItem extends StatelessWidget {
static const selectedItemColor = Palette.paleCornflowerBlue;
static const unselectedItemColor = Palette.moderateLavender;
final String address;
final String note;
final String amount;
final bool isSending;
final bool isFrozen;
final Function() onCheckBoxTap;
@override
@ -51,7 +54,7 @@ class UnspentCoinsListItem extends StatelessWidget {
width: 1.0),
borderRadius: BorderRadius.all(
Radius.circular(8.0)),
color: Theme.of(context).backgroundColor),
color: itemColor),
child: isSending
? Icon(
Icons.check,
@ -64,25 +67,53 @@ class UnspentCoinsListItem extends StatelessWidget {
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: (note?.isNotEmpty ?? false)
? MainAxisAlignment.spaceBetween
: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AutoSizeText(
amount,
style: TextStyle(
color: amountColor,
fontSize: 16,
fontWeight: FontWeight.w600
),
maxLines: 1,
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: AutoSizeText(
amount,
style: TextStyle(
color: amountColor,
fontSize: 16,
fontWeight: FontWeight.w600
),
maxLines: 1,
),
),
if (isFrozen) Container(
height: 17,
padding: EdgeInsets.only(left: 6, right: 6),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8.5)),
color: Colors.white),
alignment: Alignment.center,
child: Text(
S.of(context).frozen,
style: TextStyle(
color: amountColor,
fontSize: 7,
fontWeight: FontWeight.w600
),
)
)
],
),
AutoSizeText(
address,
if (note?.isNotEmpty ?? false) Text(
note,
style: TextStyle(
color: addressColor,
fontSize: 12,
),
maxLines: 1,
overflow: TextOverflow.ellipsis
)
]
)

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Nicht ausgegebene Münzen",
"unspent_coins_details_title" : "Details zu nicht ausgegebenen Münzen",
"freeze" : "Einfrieren",
"frozen" : "Gefroren",
"coin_control" : "Münzkontrolle (optional)",
"address_detected" : "Adresse erkannt",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Unspent coins",
"unspent_coins_details_title" : "Unspent coins details",
"freeze" : "Freeze",
"frozen" : "Frozen",
"coin_control" : "Coin control (optional)",
"address_detected" : "Address detected",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Monedas no gastadas",
"unspent_coins_details_title" : "Detalles de monedas no gastadas",
"freeze" : "Congelar",
"frozen" : "Congelada",
"coin_control" : "Control de monedas (opcional)",
"address_detected" : "Dirección detectada",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "खर्च न किए गए सिक्के",
"unspent_coins_details_title" : "अव्ययित सिक्कों का विवरण",
"freeze" : "फ्रीज",
"frozen" : "जमा हुआ",
"coin_control" : "सिक्का नियंत्रण (वैकल्पिक)",
"address_detected" : "पता लग गया",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Nepotrošeni novčići",
"unspent_coins_details_title" : "Nepotrošeni detalji o novčićima",
"freeze" : "Zamrznuti",
"frozen" : "Smrznuto",
"coin_control" : "Kontrola novca (nije obavezno)",
"address_detected" : "Adresa je otkrivena",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Monete non spese",
"unspent_coins_details_title" : "Dettagli sulle monete non spese",
"freeze" : "Congelare",
"frozen" : "Congelato",
"coin_control" : "Controllo monete (opzionale)",
"address_detected" : "Indirizzo rilevato",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "未使用のコイン",
"unspent_coins_details_title" : "未使用のコインの詳細",
"freeze" : "氷結",
"frozen" : "凍った",
"coin_control" : "コインコントロール(オプション)",
"address_detected" : "アドレスが検出されました",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "사용하지 않은 동전",
"unspent_coins_details_title" : "사용하지 않은 동전 세부 정보",
"freeze" : "얼다",
"frozen" : "겨울 왕국",
"coin_control" : "코인 제어 (옵션)",
"address_detected" : "주소 감지",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Ongebruikte munten",
"unspent_coins_details_title" : "Details van niet-uitgegeven munten",
"freeze" : "Bevriezen",
"frozen" : "Bevroren",
"coin_control" : "Muntcontrole (optioneel)",
"address_detected" : "Adres gedetecteerd",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Niewydane monety",
"unspent_coins_details_title" : "Szczegóły niewydanych monet",
"freeze" : "Zamrażać",
"frozen" : "Mrożony",
"coin_control" : "Kontrola monet (opcjonalnie)",
"address_detected" : "Wykryto adres",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Moedas não gastas",
"unspent_coins_details_title" : "Detalhes de moedas não gastas",
"freeze" : "Congelar",
"frozen" : "Congeladas",
"coin_control" : "Controle de moedas (opcional)",
"address_detected" : "Endereço detectado",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Неизрасходованные монеты",
"unspent_coins_details_title" : "Сведения о неизрасходованных монетах",
"freeze" : "Заморозить",
"frozen" : "Заморожено",
"coin_control" : "Контроль монет (необязательно)",
"address_detected" : "Обнаружен адрес",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "Невитрачені монети",
"unspent_coins_details_title" : "Відомості про невитрачені монети",
"freeze" : "Заморозити",
"frozen" : "Заморожено",
"coin_control" : "Контроль монет (необов’язково)",
"address_detected" : "Виявлено адресу",

View file

@ -488,6 +488,7 @@
"unspent_coins_title" : "未使用的硬幣",
"unspent_coins_details_title" : "未使用代幣詳情",
"freeze" : "凍結",
"frozen" : "凍結的",
"coin_control" : "硬幣控制(可選)",
"address_detected" : "檢測到地址",