OpenContacts/lib/widgets/friend_list_tile.dart
2023-05-01 19:13:40 +02:00

24 lines
No EOL
831 B
Dart

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';
import 'package:flutter/material.dart';
class FriendListTile extends StatelessWidget {
const FriendListTile({required this.friend, super.key});
final Friend friend;
@override
Widget build(BuildContext context) {
final imageUri = Aux.neosDbToHttp(friend.userProfile.iconUrl);
return ListTile(
leading: GenericAvatar(imageUri: imageUri,),
title: Text(friend.username),
subtitle: Text(friend.userStatus.onlineStatus.name),
onTap: () {
Navigator.of(context).push(MaterialPageRoute(builder: (context) => Messages(friend: friend)));
},
);
}
}