fix: More minor fixes

This commit is contained in:
Christian Pauly 2021-02-05 16:43:05 +01:00
parent 89d0a85716
commit 4c10ef5213
3 changed files with 23 additions and 15 deletions

View File

@ -16,9 +16,6 @@ class ContactListTile extends StatelessWidget {
var statusMsg = contact.presence?.statusMsg?.isNotEmpty ?? false
? contact.presence.statusMsg
: null;
if (contact.senderId == '@jana:janian.de') {
statusMsg = 'Hallo Welt';
}
return FutureBuilder<Profile>(
future:
Matrix.of(context).client.getProfileFromUserId(contact.senderId),

View File

@ -26,6 +26,8 @@ extension ClientPresenceExtension on Client {
(p.presence?.statusMsg?.isNotEmpty ?? false))
.toList(),
);
contactList.sort((a, b) => a.senderId.compareTo(b.senderId));
contactList.sort((a, b) => (a.presence.lastActiveAgo?.toDouble() ??
double.infinity)
.compareTo((b.presence.lastActiveAgo?.toDouble() ?? double.infinity)));

View File

@ -208,18 +208,27 @@ class _HomeViewState extends State<HomeView> with TickerProviderStateMixin {
return Scaffold(
appBar: appBar ??
AppBar(
centerTitle: false,
actions: [
IconButton(
icon: Icon(currentIndex == 3
? Icons.exit_to_app_outlined
: Icons.search_outlined),
onPressed: () => _pageController.indexIsChanging
? null
: _onAppBarButtonTap.add(currentIndex),
),
],
title: Text(title)),
centerTitle: false,
actions: [
IconButton(
icon: Icon(currentIndex == 3
? Icons.exit_to_app_outlined
: Icons.search_outlined),
onPressed: () => _pageController.indexIsChanging
? null
: _onAppBarButtonTap.add(currentIndex),
),
],
title: Text(title),
elevation:
AdaptivePageLayout.of(context).columnMode(context) ? 0 : null,
bottom: AdaptivePageLayout.of(context).columnMode(context)
? PreferredSize(
preferredSize: Size.fromHeight(1),
child: Divider(height: 1),
)
: null,
),
body: TabBarView(
controller: _pageController,
children: [