style: Enhanced chat details design

This commit is contained in:
Krille 2023-02-04 19:10:27 +01:00
parent 59d3793060
commit 72767f0716
2 changed files with 55 additions and 40 deletions

View File

@ -100,23 +100,31 @@ class ChatDetailsView extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
ListTile(
leading: room.canSendEvent('m.room.topic')
? CircleAvatar(
backgroundColor: Theme.of(context)
.scaffoldBackgroundColor,
foregroundColor: iconColor,
radius: Avatar.defaultSize / 2,
child: const Icon(Icons.edit_outlined),
onTap: room.canSendEvent(EventTypes.RoomTopic)
? controller.setTopicAction
: null,
trailing: room.canSendEvent(EventTypes.RoomTopic)
? Icon(
Icons.edit_outlined,
color: Theme.of(context)
.colorScheme
.onBackground,
)
: null,
title: Text(
'${L10n.of(context)!.groupDescription}:',
L10n.of(context)!.groupDescription,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.secondary,
fontWeight: FontWeight.bold)),
subtitle: LinkText(
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.bold,
),
),
),
if (room.topic.isNotEmpty)
Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16.0),
child: LinkText(
text: room.topic.isEmpty
? L10n.of(context)!.addGroupDescription
: room.topic,
@ -132,9 +140,6 @@ class ChatDetailsView extends StatelessWidget {
onLinkTap: (url) =>
UrlLauncher(context, url).launchUrl(),
),
onTap: room.canSendEvent('m.room.topic')
? controller.setTopicAction
: null,
),
const SizedBox(height: 8),
const Divider(height: 1),

View File

@ -39,16 +39,26 @@ class ParticipantListItem extends StatelessWidget {
title: Row(
children: <Widget>[
Text(user.calcDisplayname()),
permissionBatch.isEmpty
? Container()
: Container(
padding: const EdgeInsets.all(4),
if (permissionBatch.isNotEmpty)
Container(
padding: const EdgeInsets.symmetric(
horizontal: 4,
vertical: 2,
),
margin: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: Theme.of(context).secondaryHeaderColor,
color: Theme.of(context).colorScheme.primaryContainer,
borderRadius: BorderRadius.circular(8),
border: Border.all(
color: Theme.of(context).colorScheme.primary,
)),
child: Text(
permissionBatch,
style: TextStyle(
fontSize: 14,
color: Theme.of(context).colorScheme.primary,
),
),
child: Center(child: Text(permissionBatch)),
),
membershipBatch[user.membership]!.isEmpty
? Container()