// import 'package:e2ee_chat/common/global.dart'; // import 'package:e2ee_chat/presenter/chat_list.dart'; // import 'package:e2ee_chat/presenter/user_chat.dart'; // import 'package:flutter/material.dart'; // import 'package:flutter_slidable/flutter_slidable.dart'; // import 'package:provider/provider.dart'; // // class ChatListItem extends StatelessWidget { // final UserChatPresenter model; // // ChatListItem(this.model); // // @override // Widget build(BuildContext context) { // final message = model.lastMessage; // return Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // model.avatar ?? Global.defaultAvatar, // Expanded( // child: Column( // children: [ // Padding( // padding: EdgeInsets.symmetric(vertical: 8), // child: Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // Expanded( // child: Text( // model.chatName, // style: TextStyle(fontSize: 34), // overflow: TextOverflow.ellipsis, // ), // ), // Text( // _formatDate(), // style: TextStyle(fontSize: 26), // overflow: TextOverflow.ellipsis, // ), // ], // ), // ), // Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ // Expanded( // child: RichText( // text: TextSpan(children: [ // TextSpan( // text: model.isAtYou ? "[@你]" : "", // style: TextStyle(fontSize: 28), // ), // TextSpan( // text: model.isSpecialAttention ? "[特别关注]" : "", // style: TextStyle(fontSize: 28), // ), // TextSpan( // text: model.isAtAll ? "[@所有人]" : "", // style: TextStyle(fontSize: 28), // ), // TextSpan( // text: model.lastMessage?.plaintext ?? "", // style: TextStyle(fontSize: 28), // ) // ]), // overflow: TextOverflow.ellipsis, // ), // ), // (model.unReadCount > 0 && !model.isDND) // ? Container( // width: 32, // height: 32, // alignment: Alignment.center, // decoration: BoxDecoration(borderRadius: BorderRadius.circular(20)), // child: Text( // model.unReadCount.toString(), // style: TextStyle(color: Colors.white, fontSize: 26), // )) // : Container(), // model.isDND // ? Row( // children: [ // Icon(Icons.visibility_off), // model.unReadCount > 0 // ? Icon( // Icons.chat_bubble, // color: Colors.red, // ) // TODO: 小红点 // : Container() // ], // ) // : Container() // ], // ) // ], // ), // ) // ], // ); // } // // String _formatDate() { // return "1234"; // } // }