getCodeName method

String getCodeName(
  1. String fullName
)

Implementation

String getCodeName(String fullName) {
  if (fullName.isNotEmpty) {
    var code = fullName.split(" ");
    if (code.length > 1)
      return code[0].substring(0, 1).toUpperCase() +
          code[1].substring(0, 1).toUpperCase();
    if (fullName.length > 1) return fullName.substring(0, 2).toUpperCase();
    return fullName.substring(0, 1).toUpperCase();
  }
  return "-";
}