mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
fixed subaddress label (#281)
* fixed subaddress label * Added name length check
This commit is contained in:
parent
d14150f4b1
commit
12c5ed27dc
1 changed files with 13 additions and 2 deletions
|
@ -39,7 +39,18 @@ class AddressCell extends StatelessWidget {
|
|||
final Function(String) onTap;
|
||||
final Function() onEdit;
|
||||
|
||||
String get label => name ?? address;
|
||||
String get label {
|
||||
if (name.isEmpty){
|
||||
if(address.length<=16){
|
||||
return address;
|
||||
}else{
|
||||
return address.substring(0,8)+'...'+
|
||||
address.substring(address.length-8,address.length);
|
||||
}
|
||||
}else{
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -49,7 +60,7 @@ class AddressCell extends StatelessWidget {
|
|||
color: backgroundColor,
|
||||
padding: EdgeInsets.only(left: 24, right: 24, top: 28, bottom: 28),
|
||||
child: Text(
|
||||
name ?? address,
|
||||
label,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
|
|
Loading…
Reference in a new issue