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), padding: const EdgeInsets.only(left: 4.0),
child: Icon( child: Icon(
Icons.favorite_rounded, Icons.notifications_off_outlined,
size: 16, size: 16,
color: Theme.of(context).primaryColor, ),
), ),
)
: Container(),
isMuted
? Padding(
padding: const EdgeInsets.only(left: 4.0),
child: Icon(
Icons.notifications_off_outlined,
size: 16,
),
)
: Container(),
Padding( Padding(
padding: const EdgeInsets.only(left: 4.0), padding: const EdgeInsets.only(left: 4.0),
child: Text( child: Text(
@ -250,26 +239,35 @@ class ChatListItem extends StatelessWidget {
), ),
), ),
SizedBox(width: 8), SizedBox(width: 8),
room.notificationCount > 0 if (room.isFavourite)
? Container( Padding(
padding: EdgeInsets.symmetric(horizontal: 7), padding: EdgeInsets.only(
height: 20, right: room.notificationCount > 0 ? 4.0 : 0.0),
decoration: BoxDecoration( child: Icon(
color: room.highlightCount > 0 Icons.favorite_rounded,
? Colors.red size: 20,
: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(20), ),
),
if (room.notificationCount > 0)
Container(
padding: EdgeInsets.symmetric(horizontal: 7),
height: 20,
decoration: BoxDecoration(
color: room.highlightCount > 0
? Colors.red
: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(20),
),
child: Center(
child: Text(
room.notificationCount.toString(),
style: TextStyle(
color: Colors.white,
), ),
child: Center( ),
child: Text( ),
room.notificationCount.toString(), ),
style: TextStyle(
color: Colors.white,
),
),
),
)
: Text(' '),
], ],
), ),
onTap: () => clickAction(context), onTap: () => clickAction(context),