obscureText method

String obscureText({
  1. String replacement = '*',
})

Replaces all characters but spaces in this string with stars (default replacement is '*')

Implementation

String obscureText({String replacement = '*'}) {
  if (this == null) {
    return '';
  }
  return this!.replaceAll(RegExp('[^ ]'), replacement);
}