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.

58 lines
1.7 KiB

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