hideEmail static method

String hideEmail(
  1. String email,
  2. int num
)

Implementation

static String hideEmail(String email, int num) {
  final int length = email.length;
  final int replaceLength = length - num;
  final String replacement =
      List<String>.generate((replaceLength / 4).ceil(), (int _) => '***')
          .join('');
  return email.replaceRange(num, length, replacement);
}