From 90e92e79825e3c011392d3aa618a4e32dce04caa Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sat, 20 Jun 2020 11:35:54 +0200 Subject: [PATCH] Clean up design --- lib/views/chat.dart | 2 +- lib/views/chat_list.dart | 18 ++++++++++-------- lib/views/login.dart | 2 +- lib/views/sign_up.dart | 2 +- lib/views/sign_up_password.dart | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/views/chat.dart b/lib/views/chat.dart index 8c74540..34fc630 100644 --- a/lib/views/chat.dart +++ b/lib/views/chat.dart @@ -347,7 +347,7 @@ class _ChatState extends State<_Chat> { return Scaffold( extendBodyBehindAppBar: true, appBar: AppBar( - backgroundColor: Theme.of(context).appBarTheme.color.withOpacity(0.9), + backgroundColor: Theme.of(context).appBarTheme.color.withOpacity(0.95), leading: selectMode ? IconButton( icon: Icon(Icons.close), diff --git a/lib/views/chat_list.dart b/lib/views/chat_list.dart index 657180a..fc44763 100644 --- a/lib/views/chat_list.dart +++ b/lib/views/chat_list.dart @@ -437,14 +437,16 @@ class _ChatListState extends State { rooms.length + publicRoomsCount; final directChats = rooms.where((r) => r.isDirectChat).toList(); - directChats.sort((a, b) => Matrix.of(context) - .client - .presences[b.directChatMatrixID] - ?.presence - ?.statusMsg != - null - ? 1 - : -1); + final presences = + Matrix.of(context).client.presences; + directChats.sort((a, b) => + presences[b.directChatMatrixID] + ?.presence + ?.statusMsg != + null + ? 1 + : a.lastEvent.originServerTs.compareTo( + b.lastEvent.originServerTs)); return ListView.separated( controller: _scrollController, separatorBuilder: diff --git a/lib/views/login.dart b/lib/views/login.dart index 1d81bb7..306c4ac 100644 --- a/lib/views/login.dart +++ b/lib/views/login.dart @@ -184,7 +184,7 @@ class _LoginState extends State { L10n.of(context).login.toUpperCase(), style: TextStyle(color: Colors.white, fontSize: 16), ), - onPressed: () => loading ? null : login(context), + onPressed: loading ? null : () => login(context), ), ), ), diff --git a/lib/views/sign_up.dart b/lib/views/sign_up.dart index 5cb2cd2..8c84e24 100644 --- a/lib/views/sign_up.dart +++ b/lib/views/sign_up.dart @@ -155,7 +155,7 @@ class _SignUpState extends State { L10n.of(context).signUp.toUpperCase(), style: TextStyle(color: Colors.white, fontSize: 16), ), - onPressed: () => loading ? null : signUpAction(context), + onPressed: loading ? null : () => signUpAction(context), ), ), ), diff --git a/lib/views/sign_up_password.dart b/lib/views/sign_up_password.dart index 6990734..8cef828 100644 --- a/lib/views/sign_up_password.dart +++ b/lib/views/sign_up_password.dart @@ -168,7 +168,7 @@ class _SignUpPasswordState extends State { L10n.of(context).createAccountNow.toUpperCase(), style: TextStyle(color: Colors.white, fontSize: 16), ), - onPressed: () => loading ? null : _signUpAction(context), + onPressed: loading ? null : () => _signUpAction(context), ), ), ),