From 8d06735b37763fda04b75c3197c4f4a057c2e495 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 19 Nov 2021 18:33:09 +0100 Subject: [PATCH] fix: Public room design --- lib/widgets/connection_status_header.dart | 2 +- lib/widgets/public_room_bottom_sheet.dart | 60 ++++++++++++----------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/lib/widgets/connection_status_header.dart b/lib/widgets/connection_status_header.dart index 1baf897f..a6c73a4d 100644 --- a/lib/widgets/connection_status_header.dart +++ b/lib/widgets/connection_status_header.dart @@ -53,7 +53,7 @@ class _ConnectionStatusHeaderState extends State { curve: Curves.bounceInOut, height: _connected ? 0 : 36, clipBehavior: Clip.hardEdge, - decoration: BoxDecoration(color: Theme.of(context).secondaryHeaderColor), + decoration: BoxDecoration(color: Theme.of(context).colorScheme.surface), padding: const EdgeInsets.symmetric(horizontal: 12), child: Row( mainAxisAlignment: MainAxisAlignment.center, diff --git a/lib/widgets/public_room_bottom_sheet.dart b/lib/widgets/public_room_bottom_sheet.dart index 38ca8235..0af96b8c 100644 --- a/lib/widgets/public_room_bottom_sheet.dart +++ b/lib/widgets/public_room_bottom_sheet.dart @@ -74,38 +74,50 @@ class PublicRoomBottomSheet extends StatelessWidget { extendBodyBehindAppBar: true, appBar: AppBar( elevation: 0, + titleSpacing: 0, backgroundColor: Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5), - title: Text(roomAlias), + title: Text( + roomAlias, + overflow: TextOverflow.fade, + ), leading: IconButton( icon: const Icon(Icons.arrow_downward_outlined), onPressed: Navigator.of(context, rootNavigator: false).pop, tooltip: L10n.of(context).close, ), + actions: [ + TextButton.icon( + onPressed: () => _joinRoom(context), + label: Text(L10n.of(context).joinRoom), + icon: const Icon(Icons.login_outlined), + ), + ], ), body: FutureBuilder( future: _search(context), builder: (context, snapshot) { final profile = snapshot.data; - return Column( + return ListView( + padding: EdgeInsets.zero, children: [ - Expanded( - child: profile == null - ? Container( - alignment: Alignment.center, - color: Theme.of(context).secondaryHeaderColor, - child: snapshot.hasError - ? Text(snapshot.error - .toLocalizedString(context)) - : const CircularProgressIndicator - .adaptive(strokeWidth: 2), - ) - : ContentBanner( - profile.avatarUrl, - defaultIcon: Icons.person_outline, - client: Matrix.of(context).client, - ), - ), + if (profile == null) + Container( + alignment: Alignment.center, + color: Theme.of(context).secondaryHeaderColor, + child: snapshot.hasError + ? Text( + snapshot.error.toLocalizedString(context)) + : const CircularProgressIndicator.adaptive( + strokeWidth: 2), + ) + else + ContentBanner( + profile.avatarUrl, + height: 156, + defaultIcon: Icons.person_outline, + client: Matrix.of(context).client, + ), ListTile( title: Text(profile?.name ?? roomAlias.localpart), subtitle: Text( @@ -116,16 +128,6 @@ class PublicRoomBottomSheet extends StatelessWidget { ListTile( subtitle: Html(data: profile.topic), ), - Container( - width: double.infinity, - padding: const EdgeInsets.all(12), - child: ElevatedButton.icon( - onPressed: () => _joinRoom(context), - label: Text(L10n.of(context).joinRoom), - icon: const Icon(Icons.login_outlined), - ), - ), - const SizedBox(height: 8), ], ); }),