Encrypted messaging app
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
3.4 KiB

  1. import 'package:flutter/material.dart';
  2. import '/views/main/conversation_detail.dart';
  3. class ConversationListItem extends StatefulWidget{
  4. final String id;
  5. final String username;
  6. const ConversationListItem({
  7. Key? key,
  8. required this.id,
  9. required this.username,
  10. }) : super(key: key);
  11. @override
  12. _ConversationListItemState createState() => _ConversationListItemState();
  13. }
  14. class _ConversationListItemState extends State<ConversationListItem> {
  15. @override
  16. Widget build(BuildContext context) {
  17. return GestureDetector(
  18. onTap: () {
  19. Navigator.push(context, MaterialPageRoute(builder: (context){
  20. return ConversationDetail();
  21. }));
  22. },
  23. child: Container(
  24. padding: const EdgeInsets.only(left: 16,right: 16,top: 10,bottom: 10),
  25. child: Row(
  26. children: <Widget>[
  27. Expanded(
  28. child: Row(
  29. children: <Widget>[
  30. // CircleAvatar(
  31. // backgroundImage: NetworkImage(widget.imageUrl),
  32. // maxRadius: 30,
  33. // ),
  34. //const SizedBox(width: 16),
  35. Expanded(
  36. child: Container(
  37. color: Colors.transparent,
  38. child: Column(
  39. crossAxisAlignment: CrossAxisAlignment.start,
  40. children: <Widget>[
  41. Text(widget.username, style: const TextStyle(fontSize: 16)),
  42. const SizedBox(height: 6),
  43. //Text(widget.messageText,style: TextStyle(fontSize: 13,color: Colors.grey.shade600, fontWeight: widget.isMessageRead?FontWeight.bold:FontWeight.normal),),
  44. const Divider(),
  45. ],
  46. ),
  47. ),
  48. ),
  49. ],
  50. ),
  51. ),
  52. ],
  53. ),
  54. ),
  55. );
  56. }
  57. }