mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-12-26 12:58:51 +00:00
Can show group logo as group conversations logo
This commit is contained in:
parent
7db08f2653
commit
88217202f8
@ -80,7 +80,12 @@ class ConversationTile extends StatelessWidget {
|
||||
|
||||
// Leading icon
|
||||
leading: ConversationImageWidget(
|
||||
conversation: conversation, users: usersList),
|
||||
conversation: conversation,
|
||||
users: usersList,
|
||||
group: conversation.isGroupConversation
|
||||
? groupsList.getGroup(conversation.groupID)
|
||||
: null,
|
||||
),
|
||||
|
||||
// Conversation information
|
||||
isThreeLine: true,
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:comunic/lists/users_list.dart';
|
||||
import 'package:comunic/models/conversation.dart';
|
||||
import 'package:comunic/models/group.dart';
|
||||
import 'package:comunic/models/user.dart';
|
||||
import 'package:comunic/ui/widgets/account_image_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -13,13 +14,15 @@ class ConversationImageWidget extends StatelessWidget {
|
||||
final Conversation conversation;
|
||||
final UsersList users;
|
||||
final double size;
|
||||
final Group group;
|
||||
|
||||
const ConversationImageWidget(
|
||||
{Key key,
|
||||
@required this.conversation,
|
||||
@required this.users,
|
||||
this.size = 30})
|
||||
: assert(conversation != null),
|
||||
const ConversationImageWidget({
|
||||
Key key,
|
||||
@required this.conversation,
|
||||
@required this.users,
|
||||
this.group,
|
||||
this.size = 30,
|
||||
}) : assert(conversation != null),
|
||||
assert(users != null),
|
||||
assert(size > 0),
|
||||
super(key: key);
|
||||
@ -40,6 +43,13 @@ class ConversationImageWidget extends StatelessWidget {
|
||||
width: size,
|
||||
);
|
||||
|
||||
if (group != null) {
|
||||
return CachedNetworkImage(
|
||||
imageUrl: group.iconURL,
|
||||
width: size,
|
||||
);
|
||||
}
|
||||
|
||||
if (conversation.members.length < 2)
|
||||
return Icon(
|
||||
Icons.lock,
|
||||
|
Loading…
Reference in New Issue
Block a user