ListTile(
leading: Icon(FontAwesomeIcons.qrcode,
size: 50),
title: Text(record.hes, style: (
TextStyle(
fontSize: 30,
color: Color(0xFF545F61),
)
),),
subtitle: Text(record.name + " " + record.sname, style: (
TextStyle(
fontSize: 20,
color: Color(0xFF545F61),
)
),),
onTap: () => print(record.tc),
),
I have a listTile like this. When I show names and surnames I want to hide after first 2 character. Like name: "mi**" and sname: "ly***" for name:"mike" and sname:"lynch" Note: I take this records from firebase.
Maybe you can try this
record.name.replaceRange(2, record.name.length, "*" * (record.name.length - 2))
// or
record.sname.replaceRange(2, record.sname.length, "*" * (record.sname.length - 2))
try this
int visibleCharacters = 2;
var hiddenName = record.name.substring(0, visibleCharacters) +
('*' * (record.name.length - visibleCharacters));
var hiddenSurname = record.sname.substring(0, visibleCharacters) +
('*' * (record.sname.length - visibleCharacters));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.