Edited common reaction emojis, display user avatar in reaction overview
This commit is contained in:
20
lib/widget/userAvatar.dart
Normal file
20
lib/widget/userAvatar.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../model/endpointData.dart';
|
||||
|
||||
class UserAvatar extends StatelessWidget {
|
||||
final String username;
|
||||
final bool isGroup;
|
||||
const UserAvatar({required this.username, this.isGroup = false, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return CircleAvatar(
|
||||
foregroundImage: !isGroup ? Image.network("https://${EndpointData().nextcloud().full()}/avatar/$username/128").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),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user