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, Future<dynamic> tryRequestWithLoadingDialog(Future<dynamic> request,
{Function(MatrixException) onAdditionalAuth}) async { {Function(MatrixException) onAdditionalAuth}) async {
var completed = false;
final futureResult = tryRequestWithErrorToast( final futureResult = tryRequestWithErrorToast(
request, request,
onAdditionalAuth: onAdditionalAuth, onAdditionalAuth: onAdditionalAuth,
).whenComplete(() => completed = true); );
await Future.delayed(Duration(seconds: 1));
if (completed) return futureResult;
return showDialog<dynamic>( return showDialog<dynamic>(
context: context, context: context,
barrierDismissible: false, barrierDismissible: false,

View File

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