#34 Added support for Group images

#18 Added Cache for avatar images
This commit is contained in:
2024-02-25 17:05:36 +01:00
parent c2f05da96e
commit edb9b56637
5 changed files with 41 additions and 16 deletions

View File

@ -31,6 +31,7 @@ class ChatTile extends StatefulWidget {
class _ChatTileState extends State<ChatTile> {
late String username;
late UserAvatar circleAvatar;
@override
void initState() {
@ -38,6 +39,9 @@ class _ChatTileState extends State<ChatTile> {
SharedPreferences.getInstance().then((value) => {
username = value.getString("username")!
});
bool isGroup = widget.data.type != GetRoomResponseObjectConversationType.oneToOne;
circleAvatar = UserAvatar(id: isGroup ? widget.data.token : widget.data.name, isGroup: isGroup);
}
void setCurrentAsRead() {
@ -50,10 +54,9 @@ class _ChatTileState extends State<ChatTile> {
).run().then((value) => widget.query(renew: true));
}
@override
Widget build(BuildContext context) {
bool isGroup = widget.data.type != GetRoomResponseObjectConversationType.oneToOne;
UserAvatar circleAvatar = UserAvatar(username: widget.data.name, isGroup: isGroup);
return Consumer<ChatProps>(builder: (context, chatData, child) {
return ListTile(