getName method

String getName({
  1. bool needAlias = true,
  2. bool needTeamNick = true,
})

Implementation

String getName({bool needAlias = true, bool needTeamNick = true}) {
  if (needAlias && alias != null && alias!.isNotEmpty) {
    return alias!;
  }
  if (needTeamNick &&
      teamInfo.teamNick != null &&
      teamInfo.teamNick!.isNotEmpty) {
    return teamInfo.teamNick!;
  }
  if (userInfo != null) {
    if (userInfo!.name != null && userInfo!.name!.isNotEmpty) {
      return userInfo!.name!;
    }
    return userInfo!.accountId ?? "";
  }
  return teamInfo.accountId;
}