fix: tema correto na lista de murais, borda nos itens de chat e ajustes no perfil
This commit is contained in:
@@ -73,10 +73,15 @@ class ChatListItem extends StatelessWidget {
|
||||
final space = this.space;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Material(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
side: BorderSide(
|
||||
color: theme.colorScheme.surfaceContainer,
|
||||
width: 1.5,
|
||||
),
|
||||
), clipBehavior: Clip.hardEdge,
|
||||
color: backgroundColor,
|
||||
child: FutureBuilder(
|
||||
future: room.name.isEmpty ? room.loadHeroUsers() : null,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:material_ui/material_ui.dart';
|
||||
import 'package:matrix/matrix.dart';
|
||||
import 'package:tatchat/config/app_config.dart';
|
||||
import 'package:tatchat/l10n/l10n.dart';
|
||||
@@ -45,7 +45,7 @@ class MuralListItem extends StatelessWidget {
|
||||
final isMuted = room.pushRuleState != PushRuleState.notify;
|
||||
final backgroundColor = activeChat
|
||||
? theme.colorScheme.secondaryContainer
|
||||
: theme.colorScheme.surfaceContainerLow;
|
||||
: theme.colorScheme.surface;
|
||||
final description = this.description;
|
||||
final creatorName = this.creatorName;
|
||||
final followers = room.summary.mJoinedMemberCount ?? 0;
|
||||
@@ -56,7 +56,13 @@ class MuralListItem extends StatelessWidget {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
child: Material(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
side: BorderSide(
|
||||
color: theme.colorScheme.surfaceContainer,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
color: backgroundColor,
|
||||
child: InkWell(
|
||||
@@ -79,6 +85,13 @@ class MuralListItem extends StatelessWidget {
|
||||
shapeBorder: const CircleBorder(),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Text(
|
||||
@@ -93,7 +106,10 @@ class MuralListItem extends StatelessWidget {
|
||||
if (isMuted)
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(left: 4),
|
||||
child: Icon(Icons.notifications_off_outlined, size: 16),
|
||||
child: Icon(
|
||||
Icons.notifications_off_outlined,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
if (room.isFavourite)
|
||||
Padding(
|
||||
@@ -104,8 +120,14 @@ class MuralListItem extends StatelessWidget {
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
if (creatorName != null && creatorName.isNotEmpty) ...[
|
||||
const SizedBox(width: 12),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
if (creatorName != null &&
|
||||
creatorName.isNotEmpty) ...[
|
||||
// const SizedBox(width: 12),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
@@ -118,14 +140,26 @@ class MuralListItem extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(width: 8),
|
||||
const Spacer(),
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.group_outlined,
|
||||
size: 16,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(l10n.countFollowers(followers), style: mutedStyle),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
l10n.countFollowers(followers),
|
||||
style: mutedStyle,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (description != null && description.isNotEmpty)
|
||||
@@ -133,7 +167,7 @@ class MuralListItem extends StatelessWidget {
|
||||
padding: const EdgeInsets.only(top: 8),
|
||||
child: Text(
|
||||
description,
|
||||
maxLines: 2,
|
||||
maxLines: 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
|
||||
@@ -236,13 +236,17 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
final userId = client.userID;
|
||||
final l10n = L10n.of(context);
|
||||
_profileFuture ??= client.fetchOwnProfile();
|
||||
|
||||
return AlertDialog.adaptive(
|
||||
insetPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
|
||||
content: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
width: MediaQuery.of(context).size.width > 720 ? 420 : MediaQuery.of(context).size.width,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 420),
|
||||
constraints: const BoxConstraints(maxWidth: 800),
|
||||
child: Column(
|
||||
mainAxisSize: .min,
|
||||
crossAxisAlignment: .stretch,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
FutureBuilder<Profile>(
|
||||
future: _profileFuture,
|
||||
@@ -255,7 +259,7 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
children: [
|
||||
Center(
|
||||
child: Stack(
|
||||
alignment: .center,
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Avatar(
|
||||
mxContent: avatar,
|
||||
@@ -265,7 +269,8 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
onTap: avatar != null
|
||||
? () => showDialog(
|
||||
context: context,
|
||||
builder: (_) => MxcImageViewer(avatar),
|
||||
builder: (_) =>
|
||||
MxcImageViewer(avatar),
|
||||
)
|
||||
: null,
|
||||
),
|
||||
@@ -282,8 +287,8 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
width: 30,
|
||||
height: 30,
|
||||
child: Icon(
|
||||
Icons.edit_outlined,
|
||||
size: 16,
|
||||
Icons.camera_alt_outlined,
|
||||
size: 18,
|
||||
color: theme.colorScheme.onPrimary,
|
||||
),
|
||||
),
|
||||
@@ -302,7 +307,7 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
tooltip: l10n.editDisplayname,
|
||||
onEdit: _editDisplayName,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
const SizedBox(height: 0),
|
||||
_EditableLine(
|
||||
text: _statusMsg?.trim().isNotEmpty == true
|
||||
? _statusMsg!
|
||||
@@ -372,13 +377,13 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
vertical: 8,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: .min,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
userId,
|
||||
maxLines: 1,
|
||||
overflow: .ellipsis,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: theme.textTheme.bodySmall?.copyWith(
|
||||
fontFamily: 'RobotoMono',
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
@@ -426,6 +431,7 @@ class _SelfProfileDialogState extends State<SelfProfileDialog> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -448,14 +454,14 @@ class _EditableLine extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
mainAxisAlignment: .center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
text,
|
||||
maxLines: 3,
|
||||
overflow: .ellipsis,
|
||||
textAlign: .center,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
textAlign: TextAlign.center,
|
||||
style: style,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user