defaultBuilder method

  1. @override
Widget defaultBuilder(
  1. BuildContext context
)
override

Default builder for the widget, which is necessary and must been override.

Implementation

@override
Widget defaultBuilder(BuildContext context) {
  if (widget.count > 0) {
    String text = widget.count.toString();
    return TencentCloudChatThemeWidget(
        build: (context, colorTheme, textStyle) => Container(
              height: getHeight(16),
              width: text.length == 1 ? getWidth(16) : getWidth(26),
              decoration: BoxDecoration(
                color: colorTheme.tipsColor,
                borderRadius: BorderRadius.all(
                  Radius.circular(
                    getSquareSize(8),
                  ),
                ),
              ),
              child: Center(
                child: Text(
                  text,
                  textAlign: TextAlign.center,
                  style: TextStyle(
                    fontSize: textStyle.fontsize_10,
                    fontWeight: FontWeight.w600,
                    color: colorTheme.contactApplicationUnreadCountTextColor,
                  ),
                ),
              ),
            ));
  }
  return Container();
}