Skip to content

Commit

Permalink
chore: Improve spaces design
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Oct 31, 2024
1 parent 83f5a63 commit a51cc08
Showing 1 changed file with 24 additions and 30 deletions.
54 changes: 24 additions & 30 deletions lib/pages/chat_list/space_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,16 @@ class _SpaceViewState extends State<SpaceView> {
),
],
),
floatingActionButton: room?.canChangeStateEvent(
EventTypes.SpaceChild,
) ==
true
? FloatingActionButton.extended(
onPressed: _addChatOrSubspace,
label: Text(L10n.of(context).chat),
icon: const Icon(Icons.chat_outlined),
)
: null,
body: room == null
? const Center(
child: Icon(
Expand Down Expand Up @@ -432,34 +442,6 @@ class _SpaceViewState extends State<SpaceView> {
return Column(
mainAxisSize: MainAxisSize.min,
children: [
if (room.canChangeStateEvent(
EventTypes.SpaceChild,
) &&
filter.isEmpty) ...[
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 8,
vertical: 1,
),
child: Material(
borderRadius: BorderRadius.circular(
AppConfig.borderRadius,
),
clipBehavior: Clip.hardEdge,
child: ListTile(
onTap: _addChatOrSubspace,
leading: const CircleAvatar(
radius: Avatar.defaultSize / 2,
child: Icon(Icons.add_outlined),
),
title: Text(
L10n.of(context).addChatOrSubSpace,
style: const TextStyle(fontSize: 14),
),
),
),
),
],
SearchTitle(
title: L10n.of(context).joinedChats,
icon: const Icon(Icons.chat_outlined),
Expand Down Expand Up @@ -537,6 +519,10 @@ class _SpaceViewState extends State<SpaceView> {
BorderRadius.circular(AppConfig.borderRadius),
clipBehavior: Clip.hardEdge,
child: ListTile(
visualDensity:
const VisualDensity(vertical: -0.5),
contentPadding:
const EdgeInsets.symmetric(horizontal: 8),
onTap: () => _joinChildRoom(item),
leading: Avatar(
mxContent: item.avatarUrl,
Expand All @@ -556,9 +542,17 @@ class _SpaceViewState extends State<SpaceView> {
overflow: TextOverflow.ellipsis,
),
),
const SizedBox(width: 8),
Text(
item.numJoinedMembers.toString(),
style: TextStyle(
fontSize: 13,
color: theme.textTheme.bodyMedium!.color,
),
),
const SizedBox(width: 4),
const Icon(
Icons.add_circle_outline_outlined,
Icons.people_outlined,
size: 14,
),
],
),
Expand Down

0 comments on commit a51cc08

Please sign in to comment.