chore: Minor design changes in chatlist item

This commit is contained in:
Christian Pauly 2020-11-22 19:49:30 +01:00
parent d9590dd4e8
commit 69771122b1
2 changed files with 37 additions and 42 deletions

View File

@ -10,13 +10,10 @@ class SimpleDialogs {
Future<dynamic> tryRequestWithLoadingDialog(Future<dynamic> request,
{Function(MatrixException) onAdditionalAuth}) async {
var completed = false;
final futureResult = tryRequestWithErrorToast(
request,
onAdditionalAuth: onAdditionalAuth,
).whenComplete(() => completed = true);
await Future.delayed(Duration(seconds: 1));
if (completed) return futureResult;
);
return showDialog<dynamic>(
context: context,
barrierDismissible: false,

View File

@ -163,25 +163,14 @@ class ChatListItem extends StatelessWidget {
softWrap: false,
),
),
room.isFavourite
? Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Icon(
Icons.favorite_rounded,
size: 16,
color: Theme.of(context).primaryColor,
),
)
: Container(),
isMuted
? Padding(
if (isMuted)
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Icon(
Icons.notifications_off_outlined,
size: 16,
),
)
: Container(),
),
Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Text(
@ -250,8 +239,18 @@ class ChatListItem extends StatelessWidget {
),
),
SizedBox(width: 8),
room.notificationCount > 0
? Container(
if (room.isFavourite)
Padding(
padding: EdgeInsets.only(
right: room.notificationCount > 0 ? 4.0 : 0.0),
child: Icon(
Icons.favorite_rounded,
size: 20,
color: Theme.of(context).primaryColor,
),
),
if (room.notificationCount > 0)
Container(
padding: EdgeInsets.symmetric(horizontal: 7),
height: 20,
decoration: BoxDecoration(
@ -268,8 +267,7 @@ class ChatListItem extends StatelessWidget {
),
),
),
)
: Text(' '),
),
],
),
onTap: () => clickAction(context),