Hibok
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

34 行
983 B

  1. import 'package:chat/data/constants.dart';
  2. import 'package:flutter/material.dart';
  3. class UnreadCountDot extends StatelessWidget {
  4. final int sessionId;
  5. final int unreadCount;
  6. UnreadCountDot({this.sessionId, this.unreadCount});
  7. @override
  8. Widget build(BuildContext context) {
  9. if (unreadCount <= 0) {
  10. return Container();
  11. } else {
  12. var countStr = unreadCount.toString();
  13. if (unreadCount > 99) {
  14. countStr = '99+';
  15. }
  16. return Container(
  17. width: Constants.UnReadMsgNotifyDotSize,
  18. height: Constants.UnReadMsgNotifyDotSize,
  19. alignment: Alignment.center,
  20. decoration: BoxDecoration(
  21. borderRadius:
  22. BorderRadius.circular(Constants.UnReadMsgNotifyDotSize / 2.0),
  23. color: Color(AppColors.NotifyDotBgColor),
  24. ),
  25. child: Text(countStr,
  26. textScaleFactor: 1.0, style: AppStyles.UnreadMsgCountDotStyle),
  27. );
  28. }
  29. }
  30. }