Added details for chats with participants list

This commit is contained in:
2023-09-13 18:57:52 +02:00
parent 3b673537e5
commit 0b48c2e7ab
13 changed files with 380 additions and 20 deletions

View File

@ -5,16 +5,19 @@ import '../model/endpointData.dart';
class UserAvatar extends StatelessWidget {
final String username;
final bool isGroup;
const UserAvatar({required this.username, this.isGroup = false, super.key});
final int size;
const UserAvatar({required this.username, this.isGroup = false, this.size = 20, super.key});
@override
Widget build(BuildContext context) {
return CircleAvatar(
foregroundImage: !isGroup ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/128").image : null,
foregroundImage: !isGroup ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/$size").image : null,
backgroundColor: Theme.of(context).primaryColor,
foregroundColor: Colors.white,
onForegroundImageError: !isGroup ? (o, t) {} : null,
child: isGroup ? const Icon(Icons.group) : const Icon(Icons.person),
radius: size.toDouble(),
child: isGroup ? Icon(Icons.group, size: size.toDouble()) : Icon(Icons.person, size: size.toDouble()),
);
}
}