getIdentifier method

Widget getIdentifier()

Implementation

Widget getIdentifier() {
  if (Hera.currentUser().profile.firstName.isNotEmpty &&
      Hera.currentUser().profile.lastName.isNotEmpty) {
    return Text(
      "${Hera.currentUser().profile.firstName[0] + Hera.currentUser().profile.lastName[0]}",
      textAlign: TextAlign.center,
      style: textStyle,
    );
  } else if (Hera.currentUser().username.isNotEmpty &&
      Hera.currentUser().username.length >= 2) {
    return Text(
      "${Hera.currentUser().username[0] + Hera.currentUser().username[1]}",
      textAlign: TextAlign.center,
      style: textStyle,
    );
  } else if (Hera.currentUser().contactInfo.email.isNotEmpty &&
      Hera.currentUser().contactInfo.email.split("@").length == 2) {
    var email = Hera.currentUser().contactInfo.email.split("@");
    return Text(
      "${email[0][0] + email[1][0]}",
      textAlign: TextAlign.center,
      style: textStyle,
    );
  }
  return Icon(
    CupertinoIcons.person,
    color: CupertinoColors.white,
    size: radius * 1.4,
  );
}