masktext method
Implementation
String masktext({
int start = 0,
int end = 7,
}) {
if (this == null) return '****';
end = this!.length - 4;
assert(this!.length > 10, throw "Value cannot be less than 11");
List newChar = [];
for (var val = 0; val < this!.length; val++) {
var i = this!.split('')[val];
if (val >= start && val <= end) {
i = "*";
newChar.add(i);
} else {
newChar.add(i);
}
}
return newChar.join();
}