getInitials static method
Implementation
static String getInitials(String string) {
List<String> names = string.split(" ");
String initials = "";
int numWords = 1;
if (numWords < names.length) {
numWords = names.length;
}
for (var i = 0; i < numWords; i++) {
initials += '${names[i][0]}';
}
return initials;
}