mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +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(String) onTap;
|
||||||
final Function() onEdit;
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
@ -49,7 +60,7 @@ class AddressCell extends StatelessWidget {
|
||||||
color: backgroundColor,
|
color: backgroundColor,
|
||||||
padding: EdgeInsets.only(left: 24, right: 24, top: 28, bottom: 28),
|
padding: EdgeInsets.only(left: 24, right: 24, top: 28, bottom: 28),
|
||||||
child: Text(
|
child: Text(
|
||||||
name ?? address,
|
label,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|
Loading…
Reference in a new issue