chat_list_item.dart 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. // import 'package:e2ee_chat/common/global.dart';
  2. // import 'package:e2ee_chat/presenter/chat_list.dart';
  3. // import 'package:e2ee_chat/presenter/user_chat.dart';
  4. // import 'package:flutter/material.dart';
  5. // import 'package:flutter_slidable/flutter_slidable.dart';
  6. // import 'package:provider/provider.dart';
  7. //
  8. // class ChatListItem extends StatelessWidget {
  9. // final UserChatPresenter model;
  10. //
  11. // ChatListItem(this.model);
  12. //
  13. // @override
  14. // Widget build(BuildContext context) {
  15. // final message = model.lastMessage;
  16. // return Row(
  17. // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  18. // children: <Widget>[
  19. // model.avatar ?? Global.defaultAvatar,
  20. // Expanded(
  21. // child: Column(
  22. // children: <Widget>[
  23. // Padding(
  24. // padding: EdgeInsets.symmetric(vertical: 8),
  25. // child: Row(
  26. // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  27. // children: <Widget>[
  28. // Expanded(
  29. // child: Text(
  30. // model.chatName,
  31. // style: TextStyle(fontSize: 34),
  32. // overflow: TextOverflow.ellipsis,
  33. // ),
  34. // ),
  35. // Text(
  36. // _formatDate(),
  37. // style: TextStyle(fontSize: 26),
  38. // overflow: TextOverflow.ellipsis,
  39. // ),
  40. // ],
  41. // ),
  42. // ),
  43. // Row(
  44. // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  45. // children: <Widget>[
  46. // Expanded(
  47. // child: RichText(
  48. // text: TextSpan(children: [
  49. // TextSpan(
  50. // text: model.isAtYou ? "[@你]" : "",
  51. // style: TextStyle(fontSize: 28),
  52. // ),
  53. // TextSpan(
  54. // text: model.isSpecialAttention ? "[特别关注]" : "",
  55. // style: TextStyle(fontSize: 28),
  56. // ),
  57. // TextSpan(
  58. // text: model.isAtAll ? "[@所有人]" : "",
  59. // style: TextStyle(fontSize: 28),
  60. // ),
  61. // TextSpan(
  62. // text: model.lastMessage?.plaintext ?? "",
  63. // style: TextStyle(fontSize: 28),
  64. // )
  65. // ]),
  66. // overflow: TextOverflow.ellipsis,
  67. // ),
  68. // ),
  69. // (model.unReadCount > 0 && !model.isDND)
  70. // ? Container(
  71. // width: 32,
  72. // height: 32,
  73. // alignment: Alignment.center,
  74. // decoration: BoxDecoration(borderRadius: BorderRadius.circular(20)),
  75. // child: Text(
  76. // model.unReadCount.toString(),
  77. // style: TextStyle(color: Colors.white, fontSize: 26),
  78. // ))
  79. // : Container(),
  80. // model.isDND
  81. // ? Row(
  82. // children: <Widget>[
  83. // Icon(Icons.visibility_off),
  84. // model.unReadCount > 0
  85. // ? Icon(
  86. // Icons.chat_bubble,
  87. // color: Colors.red,
  88. // ) // TODO: 小红点
  89. // : Container()
  90. // ],
  91. // )
  92. // : Container()
  93. // ],
  94. // )
  95. // ],
  96. // ),
  97. // )
  98. // ],
  99. // );
  100. // }
  101. //
  102. // String _formatDate() {
  103. // return "1234";
  104. // }
  105. // }