import 'package:chat/data/constants.dart';
import 'package:flutter/material.dart';

class UnreadCountDot extends StatelessWidget {
  final int sessionId;
  final int unreadCount;
  UnreadCountDot({this.sessionId, this.unreadCount});

  @override
  Widget build(BuildContext context) {
  
    if (unreadCount <= 0) {
      return Container();
    } else {
      var countStr = unreadCount.toString();
      if (unreadCount > 99) {
        countStr = '99+';
      }

      return Container(
        width: Constants.UnReadMsgNotifyDotSize,
        height: Constants.UnReadMsgNotifyDotSize,
        alignment: Alignment.center,
        decoration: BoxDecoration(
          borderRadius:
              BorderRadius.circular(Constants.UnReadMsgNotifyDotSize / 2.0),
          color: Color(AppColors.NotifyDotBgColor),
        ),
        child: Text(countStr,
            textScaleFactor: 1.0, style: AppStyles.UnreadMsgCountDotStyle),
      );
    }
  }
}