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.

67 lines
2.8 KiB

  1. import 'package:Envelope/components/custom_circle_avatar.dart';
  2. import 'package:flutter/material.dart';
  3. class FriendListItem extends StatefulWidget{
  4. final String id;
  5. final String username;
  6. final String? imagePath;
  7. const FriendListItem({
  8. Key? key,
  9. required this.id,
  10. required this.username,
  11. this.imagePath,
  12. }) : super(key: key);
  13. @override
  14. _FriendListItemState createState() => _FriendListItemState();
  15. }
  16. class _FriendListItemState extends State<FriendListItem> {
  17. @override
  18. Widget build(BuildContext context) {
  19. return GestureDetector(
  20. onTap: (){
  21. },
  22. child: Container(
  23. padding: const EdgeInsets.only(left: 16,right: 16,top: 10,bottom: 10),
  24. child: Row(
  25. children: <Widget>[
  26. Expanded(
  27. child: Row(
  28. children: <Widget>[
  29. CustomCircleAvatar(
  30. initials: widget.username[0].toUpperCase(),
  31. imagePath: widget.imagePath,
  32. ),
  33. const SizedBox(width: 16),
  34. Expanded(
  35. child: Align(
  36. alignment: Alignment.centerLeft,
  37. child: Container(
  38. color: Colors.transparent,
  39. child: Column(
  40. crossAxisAlignment: CrossAxisAlignment.start,
  41. children: <Widget>[
  42. Text(widget.username, style: const TextStyle(fontSize: 16)),
  43. // Text(
  44. // widget.messageText,
  45. // style: TextStyle(fontSize: 13,
  46. // color: Colors.grey.shade600,
  47. // fontWeight: widget.isMessageRead?FontWeight.bold:FontWeight.normal
  48. // ),
  49. // ),
  50. ],
  51. ),
  52. ),
  53. ),
  54. ),
  55. ],
  56. ),
  57. ),
  58. ],
  59. ),
  60. ),
  61. );
  62. }
  63. }