mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-29 16:26:27 +00:00
Add support for conversation image
This commit is contained in:
parent
a23b76b552
commit
08c77340a0
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:comunic/helpers/conversations_helper.dart';
|
import 'package:comunic/helpers/conversations_helper.dart';
|
||||||
import 'package:comunic/lists/users_list.dart';
|
import 'package:comunic/lists/users_list.dart';
|
||||||
import 'package:comunic/models/conversation.dart';
|
import 'package:comunic/models/conversation.dart';
|
||||||
@ -66,13 +67,21 @@ class ConversationTile extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
// Tile color
|
||||||
|
tileColor: conversation.sawLastMessage
|
||||||
|
? null
|
||||||
|
: (conversation.color ?? Colors.blue).withOpacity(0.2),
|
||||||
|
|
||||||
// Leading icon
|
// Leading icon
|
||||||
leading: Icon(
|
leading: conversation.logoURL == null
|
||||||
conversation.sawLastMessage ? Icons.check_circle : Icons.lens,
|
? Icon(
|
||||||
color: conversation.sawLastMessage
|
conversation.sawLastMessage ? Icons.check_circle : Icons.lens,
|
||||||
? (darkTheme() ? darkAccentColor : null)
|
color: (darkTheme() ? darkAccentColor : null),
|
||||||
: conversation.color ?? Colors.blue,
|
)
|
||||||
),
|
: CachedNetworkImage(
|
||||||
|
imageUrl: conversation.logoURL,
|
||||||
|
width: 30,
|
||||||
|
),
|
||||||
|
|
||||||
// Conversation information
|
// Conversation information
|
||||||
isThreeLine: true,
|
isThreeLine: true,
|
||||||
|
@ -17,6 +17,7 @@ class CustomListTile extends StatelessWidget {
|
|||||||
final GestureTapCallback onTap;
|
final GestureTapCallback onTap;
|
||||||
final GestureLongPressCallback onLongPress;
|
final GestureLongPressCallback onLongPress;
|
||||||
final bool selected;
|
final bool selected;
|
||||||
|
final Color tileColor;
|
||||||
|
|
||||||
/// Custom onLongPress function
|
/// Custom onLongPress function
|
||||||
final Function(Size, Offset) onLongPressWithInfo;
|
final Function(Size, Offset) onLongPressWithInfo;
|
||||||
@ -39,6 +40,7 @@ class CustomListTile extends StatelessWidget {
|
|||||||
this.selected = false,
|
this.selected = false,
|
||||||
this.onLongPressWithInfo,
|
this.onLongPressWithInfo,
|
||||||
this.onLongPressOpenMenu,
|
this.onLongPressOpenMenu,
|
||||||
|
this.tileColor,
|
||||||
}) : assert(isThreeLine != null),
|
}) : assert(isThreeLine != null),
|
||||||
assert(enabled != null),
|
assert(enabled != null),
|
||||||
assert(selected != null),
|
assert(selected != null),
|
||||||
@ -48,6 +50,7 @@ class CustomListTile extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
|
tileColor: tileColor,
|
||||||
leading: leading,
|
leading: leading,
|
||||||
title: title,
|
title: title,
|
||||||
subtitle: subtitle,
|
subtitle: subtitle,
|
||||||
|
Loading…
Reference in New Issue
Block a user