Minor fixes

This commit is contained in:
Christian Pauly 2020-04-26 19:08:55 +02:00
parent c23c8ac957
commit 1cdbfc4f0b
2 changed files with 90 additions and 82 deletions

View file

@ -4,9 +4,7 @@ import 'package:flutter/material.dart';
extension PresenceExtension on Presence { extension PresenceExtension on Presence {
bool get isStatus => bool get isStatus =>
(statusMsg?.isNotEmpty ?? false) || (statusMsg?.isNotEmpty ?? false) || this.displayname != null;
this.displayname != null ||
this.avatarUrl != null;
String getLocalizedStatusMessage(BuildContext context) { String getLocalizedStatusMessage(BuildContext context) {
if (!isStatus) return null; if (!isStatus) return null;

View file

@ -229,7 +229,9 @@ class _ChatListState extends State<ChatList> {
setState(() => selectMode = SelectMode.normal); setState(() => selectMode = SelectMode.normal);
} }
return Scaffold( return Scaffold(
drawer: Drawer( drawer: selectMode == SelectMode.share
? null
: Drawer(
child: SafeArea( child: SafeArea(
child: ListView( child: ListView(
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
@ -281,9 +283,17 @@ class _ChatListState extends State<ChatList> {
), ),
), ),
appBar: AppBar( appBar: AppBar(
leading: selectMode != SelectMode.share
? null
: IconButton(
icon: Icon(Icons.close),
onPressed: () => Matrix.of(context).shareContent = null,
),
elevation: Matrix.of(context).client.statusList.isEmpty ? null : 0, elevation: Matrix.of(context).client.statusList.isEmpty ? null : 0,
titleSpacing: 0, titleSpacing: 0,
title: Container( title: selectMode == SelectMode.share
? Text(I18n.of(context).share)
: Container(
padding: EdgeInsets.all(8), padding: EdgeInsets.all(8),
height: 42, height: 42,
margin: EdgeInsets.only(right: 8), margin: EdgeInsets.only(right: 8),
@ -327,8 +337,8 @@ class _ChatListState extends State<ChatList> {
), ),
), ),
), ),
floatingActionButton: AdaptivePageLayout.columnMode(context) && floatingActionButton: (AdaptivePageLayout.columnMode(context) ||
selectMode == SelectMode.share selectMode == SelectMode.share)
? null ? null
: SpeedDial( : SpeedDial(
child: Icon(Icons.add), child: Icon(Icons.add),