refactor: Select chat list item logic
This commit is contained in:
parent
19fc1378fb
commit
cd1f8cc386
|
@ -146,10 +146,10 @@ class ChatListItem extends StatelessWidget {
|
||||||
? 20.0
|
? 20.0
|
||||||
: 14.0
|
: 14.0
|
||||||
: 0.0;
|
: 0.0;
|
||||||
return Center(
|
return ListTile(
|
||||||
child: Material(
|
selected: selected,
|
||||||
color: FluffyThemes.chatListItemColor(context, activeChat, selected),
|
selectedTileColor:
|
||||||
child: ListTile(
|
FluffyThemes.chatListItemColor(context, activeChat, selected),
|
||||||
onLongPress: onLongPress,
|
onLongPress: onLongPress,
|
||||||
leading: selected
|
leading: selected
|
||||||
? Container(
|
? Container(
|
||||||
|
@ -271,8 +271,7 @@ class ChatListItem extends StatelessWidget {
|
||||||
color: room.isUnread
|
color: room.isUnread
|
||||||
? Theme.of(context).colorScheme.secondary
|
? Theme.of(context).colorScheme.secondary
|
||||||
: null,
|
: null,
|
||||||
fontWeight:
|
fontWeight: room.isUnread ? FontWeight.bold : null,
|
||||||
room.isUnread ? FontWeight.bold : null,
|
|
||||||
decoration: room.lastEvent?.redacted == true
|
decoration: room.lastEvent?.redacted == true
|
||||||
? TextDecoration.lineThrough
|
? TextDecoration.lineThrough
|
||||||
: null,
|
: null,
|
||||||
|
@ -309,8 +308,6 @@ class ChatListItem extends StatelessWidget {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: () => clickAction(context),
|
onTap: () => clickAction(context),
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue