getBadge method

Widget getBadge()

Implementation

Widget getBadge() {
  var badgesHeight = badgeNumber > 0 ? badgeHeight : redDotHeight;
  return GTFBadgePositioned(
    position: badgePosition,
    child: Container(
      alignment: Alignment.center,
      height: badgesHeight,
      width: badgeNumber > 0 ? null : badgesHeight,
      padding: EdgeInsets.symmetric(
        horizontal: badgeNumber > 9 ? 2 : 3,
      ),
      decoration: BoxDecoration(
        borderRadius: BorderRadius.circular(badgesHeight / 2),
        color: badgeColor,
        border: Border.all(
          width: badgeBorderWidth,
          color: GTFColor.white,
        ),
      ),
      child: badgeNumber > 0
          ? Text(
              getBadgeText(),
              style: TextStyle(
                color: badgeTextColor,
                fontSize: badgeTextFontSize,
                height: 1,
              ),
            )
          : Container(),
    ),
  );
}