mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-02 16:14:21 +01:00
fix: Public room design
This commit is contained in:
parent
99d9149ef9
commit
8d06735b37
@ -53,7 +53,7 @@ class _ConnectionStatusHeaderState extends State<ConnectionStatusHeader> {
|
|||||||
curve: Curves.bounceInOut,
|
curve: Curves.bounceInOut,
|
||||||
height: _connected ? 0 : 36,
|
height: _connected ? 0 : 36,
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
decoration: BoxDecoration(color: Theme.of(context).secondaryHeaderColor),
|
decoration: BoxDecoration(color: Theme.of(context).colorScheme.surface),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -74,38 +74,50 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
|||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
|
titleSpacing: 0,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5),
|
Theme.of(context).scaffoldBackgroundColor.withOpacity(0.5),
|
||||||
title: Text(roomAlias),
|
title: Text(
|
||||||
|
roomAlias,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
),
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: const Icon(Icons.arrow_downward_outlined),
|
icon: const Icon(Icons.arrow_downward_outlined),
|
||||||
onPressed: Navigator.of(context, rootNavigator: false).pop,
|
onPressed: Navigator.of(context, rootNavigator: false).pop,
|
||||||
tooltip: L10n.of(context).close,
|
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<PublicRoomsChunk>(
|
body: FutureBuilder<PublicRoomsChunk>(
|
||||||
future: _search(context),
|
future: _search(context),
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
final profile = snapshot.data;
|
final profile = snapshot.data;
|
||||||
return Column(
|
return ListView(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
if (profile == null)
|
||||||
child: profile == null
|
Container(
|
||||||
? Container(
|
alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
color: Theme.of(context).secondaryHeaderColor,
|
||||||
color: Theme.of(context).secondaryHeaderColor,
|
child: snapshot.hasError
|
||||||
child: snapshot.hasError
|
? Text(
|
||||||
? Text(snapshot.error
|
snapshot.error.toLocalizedString(context))
|
||||||
.toLocalizedString(context))
|
: const CircularProgressIndicator.adaptive(
|
||||||
: const CircularProgressIndicator
|
strokeWidth: 2),
|
||||||
.adaptive(strokeWidth: 2),
|
)
|
||||||
)
|
else
|
||||||
: ContentBanner(
|
ContentBanner(
|
||||||
profile.avatarUrl,
|
profile.avatarUrl,
|
||||||
defaultIcon: Icons.person_outline,
|
height: 156,
|
||||||
client: Matrix.of(context).client,
|
defaultIcon: Icons.person_outline,
|
||||||
),
|
client: Matrix.of(context).client,
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(profile?.name ?? roomAlias.localpart),
|
title: Text(profile?.name ?? roomAlias.localpart),
|
||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
@ -116,16 +128,6 @@ class PublicRoomBottomSheet extends StatelessWidget {
|
|||||||
ListTile(
|
ListTile(
|
||||||
subtitle: Html(data: profile.topic),
|
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),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
Loading…
Reference in New Issue
Block a user