OpenContacts/lib/widgets/friend_list_tile.dart

24 lines
831 B
Dart
Raw Normal View History

2023-05-01 13:13:40 -04:00
import 'package:contacts_plus_plus/auxiliary.dart';
import 'package:contacts_plus_plus/models/friend.dart';
import 'package:contacts_plus_plus/widgets/generic_avatar.dart';
import 'package:contacts_plus_plus/widgets/messages.dart';
2023-04-30 09:43:59 -04:00
import 'package:flutter/material.dart';
class FriendListTile extends StatelessWidget {
const FriendListTile({required this.friend, super.key});
final Friend friend;
@override
Widget build(BuildContext context) {
2023-04-30 17:14:29 -04:00
final imageUri = Aux.neosDbToHttp(friend.userProfile.iconUrl);
2023-04-30 09:43:59 -04:00
return ListTile(
2023-04-30 17:14:29 -04:00
leading: GenericAvatar(imageUri: imageUri,),
2023-04-30 09:43:59 -04:00
title: Text(friend.username),
subtitle: Text(friend.userStatus.onlineStatus.name),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => Messages(friend: friend)));
},
);
}
}