style: Redesign public room bottomsheets

This commit is contained in:
Krille 2023-01-08 11:41:42 +01:00
parent 1f71227221
commit 8632154832

View File

@ -7,7 +7,7 @@ import 'package:matrix_link_text/link_text.dart';
import 'package:vrouter/vrouter.dart'; import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/utils/url_launcher.dart'; import 'package:fluffychat/utils/url_launcher.dart';
import 'package:fluffychat/widgets/content_banner.dart'; import 'package:fluffychat/widgets/avatar.dart';
import 'package:fluffychat/widgets/matrix.dart'; import 'package:fluffychat/widgets/matrix.dart';
import '../utils/localized_exception_extension.dart'; import '../utils/localized_exception_extension.dart';
@ -71,12 +71,7 @@ class PublicRoomBottomSheet extends StatelessWidget {
final roomAlias = this.roomAlias; final roomAlias = this.roomAlias;
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true,
appBar: AppBar( appBar: AppBar(
elevation: 0,
titleSpacing: 0,
backgroundColor:
Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5),
title: Text( title: Text(
roomAlias ?? chunk!.name ?? chunk!.roomId, roomAlias ?? chunk!.name ?? chunk!.roomId,
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
@ -87,10 +82,13 @@ class PublicRoomBottomSheet extends StatelessWidget {
tooltip: L10n.of(context)!.close, tooltip: L10n.of(context)!.close,
), ),
actions: [ actions: [
TextButton.icon( Padding(
onPressed: () => _joinRoom(context), padding: const EdgeInsets.all(8.0),
label: Text(L10n.of(context)!.joinRoom), child: OutlinedButton.icon(
icon: const Icon(Icons.login_outlined), onPressed: () => _joinRoom(context),
label: Text(L10n.of(context)!.joinRoom),
icon: const Icon(Icons.login_outlined),
),
), ),
], ],
), ),
@ -112,11 +110,16 @@ class PublicRoomBottomSheet extends StatelessWidget {
strokeWidth: 2), strokeWidth: 2),
) )
else else
ContentBanner( Center(
mxContent: profile.avatarUrl, child: Padding(
height: 156, padding: const EdgeInsets.all(16.0),
defaultIcon: Icons.group_outlined, child: Avatar(
client: Matrix.of(context).client, mxContent: profile.avatarUrl,
name: profile.name ?? roomAlias,
size: Avatar.defaultSize * 3,
fontSize: 36,
),
),
), ),
ListTile( ListTile(
title: Text(profile?.name ?? title: Text(profile?.name ??