call_item_view.dart 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import 'package:cached_network_image/cached_network_image.dart';
  2. import 'package:flutter/material.dart';
  3. import 'package:youtube/data/models/call_model.dart';
  4. import 'package:intl/intl.dart';
  5. import '../../../shared/theme.dart';
  6. class CallItemView extends StatelessWidget {
  7. final CallModel callModel;
  8. const CallItemView({Key? key, required this.callModel}) : super(key: key);
  9. @override
  10. Widget build(BuildContext context) {
  11. return ListTile(
  12. subtitle: Text('${callModel.status}'),
  13. title: Row(
  14. children: [
  15. callModel.otherUser!.avatar.isNotEmpty ? CircleAvatar(
  16. backgroundColor: defaultColor,
  17. radius: 22.0,
  18. backgroundImage: CachedNetworkImageProvider(
  19. callModel.otherUser!.avatar,
  20. ),
  21. ) : const Icon(Icons.person),
  22. const SizedBox(width: 10.0,),
  23. Expanded(child: Text(callModel.otherUser!.name)),
  24. Text(DateFormat('dd/MM/yyyy HH:mm:ss').format(
  25. DateTime.fromMillisecondsSinceEpoch(
  26. callModel.createAt!.toInt())),style: Theme.of(context).textTheme.bodySmall,)
  27. ],
  28. ),
  29. );
  30. }
  31. }