add note as a header

This commit is contained in:
Serhii 2023-03-24 11:55:52 +02:00
parent 52fd029c7d
commit 9c50712608

View file

@ -30,10 +30,8 @@ class UnspentCoinsListItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final itemColor = isSending? selectedItemColor : unselectedItemColor; final itemColor = isSending? selectedItemColor : unselectedItemColor;
final _note = (note?.isNotEmpty ?? false) ? note : address;
return Container( return Container(
height: 62, height: 80,
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(12)), borderRadius: BorderRadius.all(Radius.circular(12)),
@ -52,49 +50,61 @@ class UnspentCoinsListItem extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Expanded(
mainAxisSize: MainAxisSize.max, child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisSize: MainAxisSize.max,
crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.center,
Expanded( children: [
child: AutoSizeText( AutoSizeText(
amount, note,
style: TextStyle( style: TextStyle(
color: amountColor, color: amountColor,
fontSize: 16, fontSize: 15,
fontWeight: FontWeight.w600 fontWeight: FontWeight.w600
), ),
maxLines: 1, maxLines: 1,
), ),
), if (isFrozen) Container(
if (isFrozen) Container( height: 17,
height: 17, padding: EdgeInsets.only(left: 6, right: 6),
padding: EdgeInsets.only(left: 6, right: 6), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(8.5)),
borderRadius: BorderRadius.all(Radius.circular(8.5)), color: Colors.white),
color: Colors.white), alignment: Alignment.center,
alignment: Alignment.center, child: Text(
child: Text( S.of(context).frozen,
S.of(context).frozen, style: TextStyle(
style: TextStyle( color: amountColor,
color: amountColor, fontSize: 7,
fontSize: 7, fontWeight: FontWeight.w600
fontWeight: FontWeight.w600 ),
), )
) )
) ],
],
),
Text(
_note,
style: TextStyle(
color: addressColor,
fontSize: 12,
), ),
maxLines: 1, ),
overflow: TextOverflow.ellipsis Expanded(
) child: AutoSizeText(
amount,
style: TextStyle(
color: amountColor,
fontSize: 15,
fontWeight: FontWeight.w600
),
maxLines: 1,
),
),
Expanded(
child: AutoSizeText(
address,
style: TextStyle(
color: addressColor,
fontSize: 12,
),
maxLines: 1,
),
),
] ]
) )
) )