getName method

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

Implementation

String getName({bool needAlias = true}) {
  if (needAlias && alias != null && alias!.isNotEmpty) {
    return alias!;
  }
  if (teamInfo.teamNick != null && teamInfo.teamNick!.isNotEmpty) {
    return teamInfo.teamNick!;
  }
  if (userInfo != null) {
    if (userInfo!.nick != null && userInfo!.nick!.isNotEmpty) {
      return userInfo!.nick!;
    }
    return userInfo!.userId ?? "";
  }
  return teamInfo.account!;
}