tuiBuild method

  1. @override
Widget tuiBuild(
  1. BuildContext context,
  2. TUIKitBuildValue value
)
override

Implementation

@override
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
  final TUITheme theme = value.theme;

  final unreadText = generateUnreadText();
  final fontSize = generateFontSize(unreadText);
  return Container(
    width: width,
    height: height,
    alignment: Alignment.center,
    decoration: BoxDecoration(
      shape: BoxShape.circle,
      color: theme.conversationItemUnreadCountBgColor ??
          CommonColor.cautionColor,
    ),
    child: unreadText != "0"
        ? Center(
            child: Text(
              unreadText,
              style: TextStyle(
                color: theme.conversationItemUnreadCountTextColor,
                fontSize: fontSize,
              ),
            ),
          )
        : null,
  );
}