hideEmail property

String get hideEmail

隐藏邮箱

Implementation

String get hideEmail {
  if (!contains('@')) return this;
  final parts = split('@');
  if (parts.length != 2) return this;
  final username = parts[0];
  final domain = parts[1];
  if (username.length <= 2) return this;
  return '${username.substring(0, 2)}***@$domain';
}