import 'package:flutter/material.dart'; import '/views/main/conversation_detail.dart'; class ConversationListItem extends StatefulWidget{ final String id; final String username; const ConversationListItem({ Key? key, required this.id, required this.username, }) : super(key: key); @override _ConversationListItemState createState() => _ConversationListItemState(); } class _ConversationListItemState extends State { @override Widget build(BuildContext context) { return GestureDetector( onTap: () { Navigator.push(context, MaterialPageRoute(builder: (context){ return ConversationDetail(); })); }, child: Container( padding: const EdgeInsets.only(left: 16,right: 16,top: 10,bottom: 10), child: Row( children: [ Expanded( child: Row( children: [ // CircleAvatar( // backgroundImage: NetworkImage(widget.imageUrl), // maxRadius: 30, // ), //const SizedBox(width: 16), Expanded( child: Container( color: Colors.transparent, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text(widget.username, style: const TextStyle(fontSize: 16)), const SizedBox(height: 6), //Text(widget.messageText,style: TextStyle(fontSize: 13,color: Colors.grey.shade600, fontWeight: widget.isMessageRead?FontWeight.bold:FontWeight.normal),), const Divider(), ], ), ), ), ], ), ), ], ), ), ); } }