fixed subaddress label (#281)

* fixed subaddress label

* Added name length check
This commit is contained in:
Serhii 2022-03-08 13:11:32 +02:00 committed by GitHub
parent d14150f4b1
commit 12c5ed27dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(