getInitials static method

String getInitials(
  1. String value
)

Implementation

static String getInitials(String value) {
  if (value.isNotEmpty) {
    return value
        .trim()
        .split(' ')
        .map((e) => e[0])
        .take(2)
        .join()
        .toUpperCase();
  }
  return '';
}